Exemple #1
0
        public void ApplyTo(DockPanel dockPanel)
        {
            if (Extender.AutoHideStripFactory == null ||
                Extender.AutoHideWindowFactory == null ||
                Extender.DockIndicatorFactory == null ||
                Extender.DockOutlineFactory == null ||
                Extender.DockPaneCaptionFactory == null ||
                Extender.DockPaneFactory == null ||
                Extender.DockPaneSplitterControlFactory == null ||
                Extender.DockPaneStripFactory == null ||
                Extender.DockWindowFactory == null ||
                Extender.FloatWindowFactory == null ||
                Extender.PaneIndicatorFactory == null ||
                Extender.PanelIndicatorFactory == null ||
                Extender.WindowSplitterControlFactory == null)
            {
                throw new InvalidOperationException(Strings.Theme_MissingFactory);
            }

            if (dockPanel.Panes.Count > 0)
            {
                throw new InvalidOperationException(Strings.Theme_PaneNotClosed);
            }

            if (dockPanel.FloatWindows.Count > 0)
            {
                throw new InvalidOperationException(Strings.Theme_FloatWindowNotClosed);
            }

            if (dockPanel.Contents.Count > 0)
            {
                throw new InvalidOperationException(Strings.Theme_DockContentNotClosed);
            }

            if (ColorPalette == null)
            {
                dockPanel.ResetDummy();
            }
            else
            {
                _dockBackColor          = dockPanel.DockBackColor;
                dockPanel.DockBackColor = ColorPalette.MainWindowActive.Background;
                dockPanel.SetDummy();
            }

            _showAutoHideContentOnHover          = dockPanel.ShowAutoHideContentOnHover;
            dockPanel.ShowAutoHideContentOnHover = ShowAutoHideContentOnHover;
        }