예제 #1
0
 public ComHandle(THandle handleOrManagedObject)
 {
     if (handleOrManagedObject == null)
     {
         _handle        = null;
         _managedObject = null;
     }
     else if (Marshal.IsComObject(handleOrManagedObject))
     {
         _handle        = handleOrManagedObject;
         _managedObject = ComAggregate.GetManagedObject <TObject>(handleOrManagedObject);
     }
     else
     {
         _handle        = (THandle)ComAggregate.TryGetWrapper(handleOrManagedObject);
         _managedObject = (TObject)handleOrManagedObject;
     }
 }