示例#1
0
        public void Shutdown()
        {
            logger.Debug("SystemManager::Shutdown() " + Initialized);

            //if (!Initialized)
            //{
            //	return;
            //}

            SystemEvents.DisplaySettingsChanged -= SystemEvents_DisplaySettingsChanged;
            SystemEvents.SessionSwitch          -= SystemEvents_SessionSwitch;

            if (notifyHandles != null && notifyHandles.Count > 0)
            {
                foreach (var handle in notifyHandles.Values)
                {
                    var result = UsbDeviceManager.UnregisterNotification(handle);
                }
            }

            if (notifyWindow != null)
            {
                notifyWindow.DestroyWindow();

                notifyWindow = null;
            }

            Initialized = false;
        }
        public void Close()
        {
            logger.Debug("WTSSessionManager::Close()");

            if (nativeWindow != null)
            {
                var hWnd   = nativeWindow.Handle;
                var result = UnregisterNotification(hWnd);

                nativeWindow.DestroyWindow();

                nativeWindow = null;
            }
        }