Example #1
0
 public Tip()
 {
     Loaded += delegate {
         AddPlacementTargetEvents(PlacementTarget);
     };
     Unloaded += delegate {
         hwndSource?.Dispose();
         RemovePlacementTargetEvents(PlacementTarget);
     };
     BuildWindow();
 }
Example #2
0
 protected override void OnClosed(EventArgs e)
 {
     hwndSource?.Dispose();
     hwndSource = null;
     base.OnClosed(e);
     Application.Current.Shutdown();
 }
Example #3
0
 protected virtual void Dispose(bool _disposing)
 {
     if (_disposing)
     {
         _source?.Dispose();
     }
 }
Example #4
0
 protected virtual void Dispose(bool disposing)
 {
     if (disposing)
     {
         _hWndSource?.Dispose();
     }
 }
Example #5
0
 public void Dispose()
 {
     if (source != null)
     {
         source.RemoveHook(hwndSourceHook);
         source.Dispose();
     }
 }
Example #6
0
 protected override void OnClosed(EventArgs e)
 {
     hwndSource?.Dispose();
     hwndSource = null;
     base.OnClosed(e);
     SystemEvents.SessionSwitch -= SystemEvents_SessionSwitch;
     Application.Current.Shutdown();
 }
 public void OnDetaching()
 {
     this.associatedObject.SourceInitialized -= AssociatedObject_SourceInitialized;
     if (hwndSource != null)
     {
         hwndSource.RemoveHook(WindowProc);
         hwndSource.Dispose();
     }
 }
 protected override void DestroyWindowCore(System.Runtime.InteropServices.HandleRef hwnd)
 {
     if (_internalHwndSource != null)
     {
         _internalHwndSource.ContentRendered -= _internalHwndSource_ContentRendered;
         _internalHwndSource.Dispose();
         _internalHwndSource = null;
     }
 }
 public void Dispose()
 {
     if (_hwndSource != null)
     {
         _hwndSource.Dispose();
     }
     WebView.SetHandle(IntPtr.Zero);
     WebView.Destroy();
 }
Example #10
0
 protected override void OnClosed(EventArgs e)
 {
     if (_hwndSource != null)
     {
         _hwndSource.Dispose();
         _hwndSource = null;
     }
     base.OnClosed(e);
 }
Example #11
0
 /// <summary>
 /// Closes and destroys the Control.
 /// </summary>
 public void Close()
 {
     if (_hwndSource != null)
     {
         _hwndSource.Dispose();
         _hwndSource = null;
     }
     _instance = null;
 }
Example #12
0
 protected override void DestroyWindowCore(HandleRef hwnd)
 {
     _manager.InternalRemoveLogicalChild(_rootPresenter);
     if (_wpfContentHost != null)
     {
         _wpfContentHost.Dispose();
         _wpfContentHost = null;
     }
 }
 protected override void DestroyWindowCore(HandleRef hwnd)
 {
     if (_internalHwndSource != null)
     {
         _internalHwndSource.ContentRendered -= _internalHwndSource_ContentRendered;
         _internalHwndSource.Dispose();
         _internalHwndSource = null;
     }
 }
Example #14
0
 protected override void OnClosing(CancelEventArgs e)
 {
     base.OnClosing(e);
     if (hwndSource != null)
     {
         hwndSource.RemoveHook(WindowRawInputHandler);
         hwndSource.Dispose();
     }
 }
Example #15
0
        public void Deactivate()
        {
            if (mIsActivated)
            {
                mHwndSource.Dispose();
                ViewModel.Dispose();
            }

            mIsActivated = false;
        }
Example #16
0
        /// <summary>
        /// Закрывает редактор.
        /// </summary>
        public void Close()
        {
            if (hwndSource != null)
            {
                hwndSource.Dispose();
                hwndSource = null;
            }

            instance = null;
        }
Example #17
0
        public void Close()
        {
            if (_hwndSource != null)
            {
                _hwndSource.Dispose();
                _hwndSource = null;
            }

            Control = null;
        }
Example #18
0
 internal static void Unload()
 {
     while (hotkeys.Keys.Count > 0)
     {
         Unregister(hotkeys.Keys.ElementAt(0));
     }
     source.RemoveHook(HwndHook);
     source.Dispose();
     hWnd = IntPtr.Zero;
 }
Example #19
0
        private void Dispose(bool disposing)
        {
            _windowHandleSource.RemoveHook(EventCallback);
            UnregisterHotKey(Win32Handler.Instance.MainWindowHandle, _id);

            if (disposing)
            {
                _windowHandleSource.Dispose();
            }
        }
        public void Dispose()
        {
            _hwndSource.RemoveHook(WndProc);
            _hwndSource?.Dispose();
            _hwndSource = null;

            _contextMenu  = null;
            _contextMenu2 = null;
            _contextMenu3 = null;
        }
Example #21
0
        void OnUnloaded(object sender, RoutedEventArgs e)
        {
            this.Unloaded -= new RoutedEventHandler(OnUnloaded);

            if (_hwndSrc != null)
            {
                _hwndSrc.RemoveHook(_hwndSrcHook);
                _hwndSrc.Dispose();
                _hwndSrc = null;
            }
        }
Example #22
0
 public void Dispose()
 {
     if (!disposed)
     {
         hwndSource.Dispose();
         foreach (var id in hotkeyIds)
         {
             NativeMethods.UnregisterHotKey(hwndSource.Handle, id);
         }
     }
 }
Example #23
0
        void OnViewClosed(object sender, EventArgs e)
        {
            //_hwndSource.RemoveHook(MessageProc);
            _hwndSource.Dispose();
            var handler = OnShellClosed;

            if (handler != null)
            {
                OnShellClosed();
            }
        }
Example #24
0
        public void Dispose()
        {
            if (!disposed)
            {
                NativeMethods.RemoveClipboardFormatListener(hwndSource.Handle);

                hwndSource.RemoveHook(WndProc);
                hwndSource.Dispose();
                disposed = true;
            }
        }
Example #25
0
 protected virtual void Dispose(bool disposing)
 {
     if (disposing)
     {
         _target?.Dispose();
     }
     if (IntPtr.Zero != _thumb)
     {
         ReleaseThumbnail();
     }
 }
Example #26
0
        /// <summary>
        /// Performs application-defined tasks associated with freeing, releasing, or resetting unmanaged resources.
        /// </summary>
        public void Dispose()
        {
            // Unregister hot keys.
            foreach (var hotKey in _registered)
            {
                WinApi.UnregisterHotKey(_windowHandleSource.Handle, hotKey.Value);
            }

            _windowHandleSource.RemoveHook(messagesHandler);
            _windowHandleSource.Dispose();
        }
Example #27
0
        protected override void OnClosed(EventArgs e)
        {
            if (_hwndSource != null)
            {
                _hwndSource.RemoveHook(WindowExtension.WindowProc);
                _hwndSource.Dispose();
                _hwndSource = null;
            }

            base.OnClosed(e);
        }
Example #28
0
 protected override void OnClosed(EventArgs e)
 {
     if (AppUtil.IsHotKeyEnabled)
     {
         SystemHotKey.UnRegHotKey(_thisWindowHandle, c_hotKeyId);
     }
     hwndSource?.Dispose();
     hwndSource = null;
     base.OnClosed(e);
     Application.Current.Shutdown();
 }
Example #29
0
        protected virtual void Dispose(bool disposing)
        {
            if (!_disposed)
            {
                Win32Utils.UnregisterNotification(m_hNotifyDevNode);
                m_hNotifyDevNode = IntPtr.Zero;
                hwndSource.Dispose();

                _disposed = true;
            }
        }
        private void OnUnloaded(object sender, RoutedEventArgs args)
        {
            if (_context == null)
            {
                return;
            }

            ReleaseOpenGLResources();
            _windowInfo?.Dispose();
            _hwnd?.Dispose();
        }