Пример #1
0
 public Tip()
 {
     Loaded += delegate {
         AddPlacementTargetEvents(PlacementTarget);
     };
     Unloaded += delegate {
         hwndSource?.Dispose();
         RemovePlacementTargetEvents(PlacementTarget);
     };
     BuildWindow();
 }
Пример #2
0
 protected override void OnClosed(EventArgs e)
 {
     hwndSource?.Dispose();
     hwndSource = null;
     base.OnClosed(e);
     Application.Current.Shutdown();
 }
Пример #3
0
 protected virtual void Dispose(bool _disposing)
 {
     if (_disposing)
     {
         _source?.Dispose();
     }
 }
Пример #4
0
 protected virtual void Dispose(bool disposing)
 {
     if (disposing)
     {
         _hWndSource?.Dispose();
     }
 }
Пример #5
0
 public void Dispose()
 {
     if (source != null)
     {
         source.RemoveHook(hwndSourceHook);
         source.Dispose();
     }
 }
Пример #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;
     }
 }
Пример #9
0
 public void Dispose()
 {
     if (_hwndSource != null)
     {
         _hwndSource.Dispose();
     }
     WebView.SetHandle(IntPtr.Zero);
     WebView.Destroy();
 }
Пример #10
0
 protected override void OnClosed(EventArgs e)
 {
     if (_hwndSource != null)
     {
         _hwndSource.Dispose();
         _hwndSource = null;
     }
     base.OnClosed(e);
 }
Пример #11
0
 /// <summary>
 /// Closes and destroys the Control.
 /// </summary>
 public void Close()
 {
     if (_hwndSource != null)
     {
         _hwndSource.Dispose();
         _hwndSource = null;
     }
     _instance = null;
 }
Пример #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;
     }
 }
Пример #14
0
 protected override void OnClosing(CancelEventArgs e)
 {
     base.OnClosing(e);
     if (hwndSource != null)
     {
         hwndSource.RemoveHook(WindowRawInputHandler);
         hwndSource.Dispose();
     }
 }
Пример #15
0
        public void Deactivate()
        {
            if (mIsActivated)
            {
                mHwndSource.Dispose();
                ViewModel.Dispose();
            }

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

            instance = null;
        }
Пример #17
0
        public void Close()
        {
            if (_hwndSource != null)
            {
                _hwndSource.Dispose();
                _hwndSource = null;
            }

            Control = null;
        }
Пример #18
0
 internal static void Unload()
 {
     while (hotkeys.Keys.Count > 0)
     {
         Unregister(hotkeys.Keys.ElementAt(0));
     }
     source.RemoveHook(HwndHook);
     source.Dispose();
     hWnd = IntPtr.Zero;
 }
Пример #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;
        }
Пример #21
0
        void OnUnloaded(object sender, RoutedEventArgs e)
        {
            this.Unloaded -= new RoutedEventHandler(OnUnloaded);

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

            if (handler != null)
            {
                OnShellClosed();
            }
        }
Пример #24
0
        public void Dispose()
        {
            if (!disposed)
            {
                NativeMethods.RemoveClipboardFormatListener(hwndSource.Handle);

                hwndSource.RemoveHook(WndProc);
                hwndSource.Dispose();
                disposed = true;
            }
        }
Пример #25
0
 protected virtual void Dispose(bool disposing)
 {
     if (disposing)
     {
         _target?.Dispose();
     }
     if (IntPtr.Zero != _thumb)
     {
         ReleaseThumbnail();
     }
 }
Пример #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();
        }
Пример #27
0
        protected override void OnClosed(EventArgs e)
        {
            if (_hwndSource != null)
            {
                _hwndSource.RemoveHook(WindowExtension.WindowProc);
                _hwndSource.Dispose();
                _hwndSource = null;
            }

            base.OnClosed(e);
        }
Пример #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();
 }
Пример #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();
        }