コード例 #1
0
        private void Initialize()
        {
            this.IsAvailable = false;
            VirtualDesktopCache.Initialize(this._assembly);

            this.VirtualDesktopManager = (IVirtualDesktopManager)Activator.CreateInstance(Type.GetTypeFromCLSID(CLSID.VirtualDesktopManager));
            if (ProductInfo.OSBuild >= 21359)
            {
                this.VirtualDesktopManagerInternal = new VirtualDesktopManagerInternal21359(this._assembly);
            }
            else if (ProductInfo.OSBuild >= 21313)
            {
                this.VirtualDesktopManagerInternal = new VirtualDesktopManagerInternal21313(this._assembly);
            }
            else if (ProductInfo.OSBuild >= 20231)
            {
                this.VirtualDesktopManagerInternal = new VirtualDesktopManagerInternal20231(this._assembly);
            }
            else
            {
                this.VirtualDesktopManagerInternal = new VirtualDesktopManagerInternal10240(this._assembly);
            }
            this.VirtualDesktopNotificationService = new VirtualDesktopNotificationService(this._assembly);
            this.VirtualDesktopPinnedApps          = new VirtualDesktopPinnedApps(this._assembly);
            this.ApplicationViewCollection         = new ApplicationViewCollection(this._assembly);

            this._listener?.Dispose();
            this._listener   = this.VirtualDesktopNotificationService.Register(VirtualDesktopNotification.CreateInstance(this._assembly));
            this.IsAvailable = true;
        }
コード例 #2
0
        private void Initialize()
        {
            VirtualDesktopCache.Initialize(this._assembly);

            this.VirtualDesktopManager             = (IVirtualDesktopManager)Activator.CreateInstance(Type.GetTypeFromCLSID(CLSID.VirtualDesktopManager));
            this.VirtualDesktopManagerInternal     = new VirtualDesktopManagerInternal(this._assembly);
            this.VirtualDesktopNotificationService = new VirtualDesktopNotificationService(this._assembly);
            this.VirtualDesktopPinnedApps          = new VirtualDesktopPinnedApps(this._assembly);
            this.ApplicationViewCollection         = new ApplicationViewCollection(this._assembly);

            this._listener?.Dispose();
            this._listener = this.VirtualDesktopNotificationService.Register(VirtualDesktopNotification.CreateInstance(this._assembly));
        }
        public IDisposable Register(VirtualDesktopNotification pNotification)
        {
            var dwCookie = this.Invoke <uint>(Args(pNotification));

            return(Disposable.Create(() => this.Unregister(dwCookie)));
        }