Пример #1
0
 public static void Release(ref ComRef <T> comRef)
 {
     if (comRef != null)
     {
         comRef.Dispose();
         comRef = null;
     }
 }
Пример #2
0
        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;
            }
        }
Пример #3
0
 public static T GetInstance(ComRef <T> comRef)
 {
     return(comRef == null ? null : comRef.Instance);
 }