예제 #1
0
        private void UpdateWithDesktopInfo(VirtualDesktop currentDesktop)
        {
            var desktops             = VirtualDesktop.GetDesktops();
            var currentDesktopNumber = Array.IndexOf(desktops, currentDesktop) + 1;
            var totalDesktopCount    = desktops.Length;

            if (this._infoIcon == null)
            {
                this._infoIcon = new DynamicInfoTrayIcon(totalDesktopCount);
            }

            this.ChangeIcon(this._infoIcon.GetDesktopInfoIcon(currentDesktopNumber, totalDesktopCount));
        }
예제 #2
0
        public void Reload(VirtualDesktop desktop = null)
        {
            if (Settings.General.TrayShowDesktop)
            {
                this.UpdateWithDesktopInfo(desktop ?? VirtualDesktop.Current);
            }
            else if (this._icon != this._defaultIcon)
            {
                this._infoIcon?.Dispose();
                this._infoIcon = null;

                this.ChangeIcon(this._defaultIcon);
            }
        }