//
//
//
//
// $Revision$
//
// This file is automatically generated - any changes will be lost
#pragma warning disable 1591
namespace Debugger.Wrappers.CorDebug
{
using System;
public partial class ICorDebugHeapValue2
{
private Debugger.Interop.CorDebug.ICorDebugHeapValue2 wrappedObject;
internal Debugger.Interop.CorDebug.ICorDebugHeapValue2 WrappedObject
{
get
{
return this.wrappedObject;
}
}
public ICorDebugHeapValue2(Debugger.Interop.CorDebug.ICorDebugHeapValue2 wrappedObject)
{
this.wrappedObject = wrappedObject;
ResourceManager.TrackCOMObject(wrappedObject, typeof(ICorDebugHeapValue2));
}
public static ICorDebugHeapValue2 Wrap(Debugger.Interop.CorDebug.ICorDebugHeapValue2 objectToWrap)
{
if ((objectToWrap != null))
{
return new ICorDebugHeapValue2(objectToWrap);
} else
{
return null;
}
}
~ICorDebugHeapValue2()
{
object o = wrappedObject;
wrappedObject = null;
ResourceManager.ReleaseCOMObject(o, typeof(ICorDebugHeapValue2));
}
public bool Is() where T: class
{
System.Reflection.ConstructorInfo ctor = typeof(T).GetConstructors()[0];
System.Type paramType = ctor.GetParameters()[0].ParameterType;
return paramType.IsInstanceOfType(this.WrappedObject);
}
public T As() where T: class
{
try {
return CastTo();
} catch {
return null;
}
}
public T CastTo() where T: class
{
return (T)Activator.CreateInstance(typeof(T), this.WrappedObject);
}
public static bool operator ==(ICorDebugHeapValue2 o1, ICorDebugHeapValue2 o2)
{
return ((object)o1 == null && (object)o2 == null) ||
((object)o1 != null && (object)o2 != null && o1.WrappedObject == o2.WrappedObject);
}
public static bool operator !=(ICorDebugHeapValue2 o1, ICorDebugHeapValue2 o2)
{
return !(o1 == o2);
}
public override int GetHashCode()
{
return base.GetHashCode();
}
public override bool Equals(object o)
{
ICorDebugHeapValue2 casted = o as ICorDebugHeapValue2;
return (casted != null) && (casted.WrappedObject == wrappedObject);
}
public ICorDebugHandleValue CreateHandle(CorDebugHandleType type)
{
ICorDebugHandleValue ppHandle;
Debugger.Interop.CorDebug.ICorDebugHandleValue out_ppHandle;
this.WrappedObject.CreateHandle(((Debugger.Interop.CorDebug.CorDebugHandleType)(type)), out out_ppHandle);
ppHandle = ICorDebugHandleValue.Wrap(out_ppHandle);
return ppHandle;
}
}
}
#pragma warning restore 1591