internal ComponentManagerProxy(ComponentManagerBroker broker, UnsafeNativeMethods.IMsoComponentManager original)
 {
     _broker         = broker;
     _original       = original;
     _creationThread = SafeNativeMethods.GetCurrentThreadId();
     _refCount       = 0;
 }
 internal ComponentManagerProxy(ComponentManagerBroker broker, UnsafeNativeMethods.IMsoComponentManager original)
 {
     this._broker = broker;
     this._original = original;
     this._creationThread = SafeNativeMethods.GetCurrentThreadId();
     this._refCount = 0;
 }
Ejemplo n.º 3
0
 bool UnsafeNativeMethods.IMsoComponentManager.FGetParentComponentManager(out UnsafeNativeMethods.IMsoComponentManager ppicm)
 {
     if (_original == null)
     {
         ppicm = null; return(false);
     }
     return(_original.FGetParentComponentManager(out ppicm));
 }
 public UnsafeNativeMethods.IMsoComponentManager GetProxy(long pCM)
 {
     if (this._proxy == null)
     {
         UnsafeNativeMethods.IMsoComponentManager objectForIUnknown = (UnsafeNativeMethods.IMsoComponentManager)Marshal.GetObjectForIUnknown((IntPtr)pCM);
         this._proxy = new ComponentManagerProxy(this, objectForIUnknown);
     }
     return(this._proxy);
 }
Ejemplo n.º 5
0
 private void Dispose()
 {
     if (this._original != null)
     {
         Marshal.ReleaseComObject(this._original);
         this._original    = null;
         this._components  = null;
         this._componentId = IntPtr.Zero;
         this._refCount    = 0;
         this._broker.ClearComponentManager();
     }
 }
 private void Dispose()
 {
     if (this._original != null)
     {
         Marshal.ReleaseComObject(this._original);
         this._original = null;
         this._components = null;
         this._componentId = IntPtr.Zero;
         this._refCount = 0;
         this._broker.ClearComponentManager();
     }
 }
Ejemplo n.º 7
0
 private void Dispose()
 {
     if (_original != null)
     {
         Marshal.ReleaseComObject(_original);
         _original    = null;
         _components  = null;
         _componentId = (IntPtr)0;
         _refCount    = 0;
         _broker.ClearComponentManager();
     }
 }
Ejemplo n.º 8
0
            /// <devdoc>
            ///     Revokes our component from the active component manager.  Does
            ///     nothing if there is no active component manager or we are
            ///     already invoked.
            /// </devdoc>
            private void RevokeComponent() {
                if (componentManager != null && componentID != INVALID_ID) {
                    int id = componentID;
                    UnsafeNativeMethods.IMsoComponentManager msocm = componentManager;

                    try {
                        msocm.FRevokeComponent((IntPtr)id);
                        if (Marshal.IsComObject(msocm)) {
                            Marshal.ReleaseComObject(msocm);
                        }
                    }
                    finally {
                        componentManager = null;
                        componentID = INVALID_ID;
                    }
                }
            }
Ejemplo n.º 9
0
 private void Dispose() {
     if (_original != null) {
         Marshal.ReleaseComObject(_original);
         _original = null;
         _components = null;
         _componentId = (IntPtr)0;
         _refCount = 0;
         _broker.ClearComponentManager();
     }
 }