Example #1
0
        private void _Dispose(bool disposing, bool isHwndBeingDestroyed)
        {
            if (this._isDisposed)
            {
                return;
            }
            this._isDisposed = true;
            IntPtr handle = this.Handle;
            string str    = this._className;

            if (isHwndBeingDestroyed)
            {
                base.Dispatcher.BeginInvoke(DispatcherPriority.Normal, new DispatcherOperationCallback((object arg) => MessageWindow._DestroyWindow(IntPtr.Zero, str)));
            }
            else if (this.Handle != IntPtr.Zero)
            {
                if (!base.CheckAccess())
                {
                    base.Dispatcher.BeginInvoke(DispatcherPriority.Normal, new DispatcherOperationCallback((object arg) => MessageWindow._DestroyWindow(handle, str)));
                }
                else
                {
                    MessageWindow._DestroyWindow(handle, str);
                }
            }
            MessageWindow.s_windowLookup.Remove(handle);
            this._className = null;
            this.Handle     = IntPtr.Zero;
        }
Example #2
0
 private object _DestroyWindowCallback(object arg)
 {
     object[] array = (object[])arg;
     MessageWindow._DestroyWindow((IntPtr)array[0], (string)array[1]);
     return(null);
 }