te
This commit is contained in:
parent
01151e679b
commit
57b2f0400e
265 changed files with 22828 additions and 6 deletions
84
Unused/Decal.Adapter.Wrappers/DecalWrapper.cs
Normal file
84
Unused/Decal.Adapter.Wrappers/DecalWrapper.cs
Normal file
|
|
@ -0,0 +1,84 @@
|
|||
using System;
|
||||
using System.ComponentModel;
|
||||
using System.Runtime.InteropServices;
|
||||
using Decal.Adapter.Support;
|
||||
using Decal.Interop.Core;
|
||||
|
||||
namespace Decal.Adapter.Wrappers;
|
||||
|
||||
[CLSCompliant(true)]
|
||||
public class DecalWrapper : MarshalByRefObject, IDisposable
|
||||
{
|
||||
internal static Guid IID_IDISPATCH = new Guid("{00020400-0000-0000-C000-000000000046}");
|
||||
|
||||
internal static Guid IID_IUNKNOWN = new Guid("{00000000-0000-0000-C000-000000000046}");
|
||||
|
||||
private DecalCore myDecal;
|
||||
|
||||
private bool isDisposed;
|
||||
|
||||
[CLSCompliant(false)]
|
||||
[EditorBrowsable(EditorBrowsableState.Never)]
|
||||
public DecalCore Underlying => myDecal;
|
||||
|
||||
public IntPtr Hwnd => new IntPtr(myDecal.HWND);
|
||||
|
||||
public bool Focus => myDecal.Focus;
|
||||
|
||||
internal DecalWrapper(DecalCore decal)
|
||||
{
|
||||
myDecal = decal;
|
||||
}
|
||||
|
||||
~DecalWrapper()
|
||||
{
|
||||
Dispose(disposing: false);
|
||||
}
|
||||
|
||||
public void Dispose()
|
||||
{
|
||||
Dispose(disposing: true);
|
||||
GC.SuppressFinalize(this);
|
||||
}
|
||||
|
||||
private void Dispose(bool disposing)
|
||||
{
|
||||
if (!isDisposed)
|
||||
{
|
||||
}
|
||||
if (myDecal != null)
|
||||
{
|
||||
Marshal.ReleaseComObject(myDecal);
|
||||
myDecal = null;
|
||||
}
|
||||
isDisposed = true;
|
||||
}
|
||||
|
||||
public object GetObject(string path)
|
||||
{
|
||||
return GetObject(path, IID_IDISPATCH);
|
||||
}
|
||||
|
||||
public object GetObject(string path, string iid)
|
||||
{
|
||||
return GetObject(path, new Guid(iid));
|
||||
}
|
||||
|
||||
public object GetObject(string path, Guid iid)
|
||||
{
|
||||
try
|
||||
{
|
||||
return ((IDecalCore)myDecal).get_Object(path, ref iid);
|
||||
}
|
||||
catch (Exception ex)
|
||||
{
|
||||
Util.WriteLine("Exception for {0} during get_Object: {1}", path, ex);
|
||||
return null;
|
||||
}
|
||||
}
|
||||
|
||||
public string MapPath(string path)
|
||||
{
|
||||
return myDecal.MapPath(path);
|
||||
}
|
||||
}
|
||||
Loading…
Add table
Add a link
Reference in a new issue