Example #1
0
        private void InitializeUi()
        {
            _currentCount = _Manager.Count();
            _currentFocus = _Manager.GetCurrent();
            ActivateHotkeys();

            IDictionary <int, Image> images = new Dictionary <int, Image>();

            if (_config.Buttons.ButtonType == ButtonTypeEnum.DisplayGraphic)
            {
                var    w          = SystemInformation.VirtualScreen.Width;
                var    h          = SystemInformation.VirtualScreen.Height;
                var    fakeRect   = new Rectangle(0, 0, w, h);
                double scale      = ((double)_config.Application.ApplicationHeight / (double)h);
                double imageScale = scale * 0.9;
                //var imageRect = DesktopVisualManager.ScaleRectangle(fakeRect, imageScale);
                var buttonRect = DesktopVisualManager.ScaleRectangle(fakeRect, imageScale);
                _config.Buttons.MinimumButtonWidth = buttonRect.Width;

                //images = DesktopVisualManager.LoadAllDesktopImages(fakeRect,
                //	ColorTranslator.FromHtml(_config.InactiveDesktopColors.Border),
                //	ColorTranslator.FromHtml(_config.InactiveDesktopColors.Background),
                //	ColorTranslator.FromHtml(_config.ActiveDesktopColors.Background),
                //	imageRect.Height,
                //	imageRect.Width);
            }


            for (var i = 1; i <= _config.Application.MaxDesktops; i++)
            {
                //DrawButton(i, _config.Buttons.ButtonType, images);
                DrawButton(i, _config.Buttons.ButtonType);
            }

            if (_config.Buttons.ButtonType == ButtonTypeEnum.DisplayGraphic)
            {
                QueueIconRefresh();
            }

            DrawGripperButton();

            AdjustApplicationSizeAndColor();
            //PatchButtonSizes();

            StartRefreshTimer();
            SetTopMost();


            SetStartLocation();

            //Process process = Process.GetCurrentProcess();
            //_manager.PinWindow(process.Handle);
        }
Example #2
0
        public int Count()
        {
            var result = _internalManager.Count();

            return(result);
        }