public static void Release(ref ComRef <T> comRef) { if (comRef != null) { comRef.Dispose(); comRef = null; } }
public static void Terminate(ref ComRef <T> comRef) { if (comRef != null) { int refCount = Marshal.FinalReleaseComObject(comRef.Instance); Trace.WriteLine("FinalReleaseComObject - ref count: " + refCount); comRef = null; } }
public static T GetInstance(ComRef <T> comRef) { return(comRef == null ? null : comRef.Instance); }