Esempio n. 1
0
        public SkinableWindowBorder(TopLevelWindow Window, WindowBorderSkin skin, bool IsExecluded)
        {
            _parent = Window;

            TopBorder = new SkinBorder(this);
            LeftBorder = new SkinBorder(this);
            RightBorder = new SkinBorder(this);
            BottomBorder = new SkinBorder(this);

            TitleBackgroundControl = new LayeredControl(TopBorder);
            TitleControl = new LayeredLabel(TopBorder);

            IconControl = new LayeredIcon(TopBorder);
            IconControl.Size = new Size(16, 16);

            MinimizeButton = new MinimizeButton(TopBorder);
            MaximizeButton = new MaximizeButton(TopBorder);
            CloseButton = new CloseButton(TopBorder);
            HelpButton = new HelpButton(TopBorder);

            if (Window.SizeBox)
            {
                TopBorder.LeftCornerCursor = Cursors.SizeNWSE;
                TopBorder.RightCornerCursor = Cursors.SizeNESW;
                TopBorder.TopCursor = Cursors.SizeNS;
                LeftBorder.NormalCursor = Cursors.SizeWE;
                RightBorder.NormalCursor = Cursors.SizeWE;
                BottomBorder.NormalCursor = Cursors.SizeNS;
                BottomBorder.LeftCornerCursor = Cursors.SizeNESW;
                BottomBorder.RightCornerCursor = Cursors.SizeNWSE;
            }

            _windowEventHandler = new WindowEventHandler(this, Parent);
            _settingsUpdater = new SettingsUpdater(IsExecluded, this);
            _processExitHandler = new ProcessExitHandler(this, Parent.Process);
            _skinWindowButtonsHandler = new SkinWindowButtonsHandler(this);
            _controlsChangeHandler = new SkinWindowControlsChangeHandler(this);

            Skin = skin;
        }
Esempio n. 2
0
        protected virtual void Dispose(bool disposing)
        {
            if(!_disposed){
                OnDisposed(this);

                WindowEventHandler.Dispose();

                _processExitHandler.Dispose();
                _skinWindowButtonsHandler.Dispose();
                _settingsUpdater.Dispose();

                TopBorder.Dispose();
                LeftBorder.Dispose();
                RightBorder.Dispose();
                BottomBorder.Dispose();

                TopBorder = null;
                LeftBorder = null;
                RightBorder = null;
                BottomBorder = null;

                MinimizeButton = null;
                MaximizeButton = null;
                CloseButton = null;
                HelpButton = null;

                TitleControl = null;
                TitleBackgroundControl = null;

                IconControl = null;

                _skin = null;

                _parent = null;

                _processExitHandler = null;
                _settingsUpdater = null;
                _skinWindowButtonsHandler = null;
                _windowEventHandler = null;
                _controlsChangeHandler = null;

                _disposed = true;
            }
        }