Ejemplo n.º 1
0
        /// <summary>
        /// 应用当前设置
        /// </summary>
        /// <param name="layout">The layout.</param>
        private void ApplySetting(ShellLayout layout)
        {
            BarManager barManager = WorkItem.RootWorkItem.Items.Get <BarManager>(UIExtensionSiteNames.Shell_Bar_Manager);

            if (barManager != null)
            {
                Bar bar = barManager.Bars["StatusBar"];
                if (bar != null)
                {
                    bar.Visible = layout.ShowStatusBar;
                }
            }

            XtraNavBarWorkspace naviPane = WorkItem.RootWorkItem.Items.Get <XtraNavBarWorkspace>(UIExtensionSiteNames.Shell_Workspace_NaviPane);

            if (naviPane != null)
            {
                naviPane.PaintStyleName = layout.NavPaintStyleName;
            }

            XtraTabbedMdiManager mdiManager = WorkItem.RootWorkItem.Items.Get <XtraTabbedMdiManager>(UIExtensionSiteNames.Shell_Manager_TabbedMdiManager);

            if (Shell != null && mdiManager != null)
            {
                mdiManager.MdiParent = layout.WindowLayoutMode == WindowLayoutMode.Tabbed ? Shell : null;
            }

            UserLookAndFeel.Default.SetSkinStyle(layout.DefaultSkin);
        }
Ejemplo n.º 2
0
        /// <summary>
        /// Handles the Activated event of the LoginForm control.
        /// </summary>
        /// <param name="sender">The source of the event.</param>
        /// <param name="e">The <see cref="System.EventArgs"/> instance containing the event data.</param>
        private void LoginForm_Activated(object sender, EventArgs e)
        {
            using (PropertyService propertyService = new PropertyService()) {
                ShellLayout layout = propertyService.Get(UIExtensionSiteNames.Shell_Property_ShellLayout) as ShellLayout;
                if (layout != null)
                {
                    UserLookAndFeel.Default.SetSkinStyle(layout.DefaultSkin);
                }
            }

            txtUser.Focus();
        }
Ejemplo n.º 3
0
        /// <summary>
        /// Stores the configuration.
        /// </summary>
        private void StoreConfiguration()
        {
            ShellLayout layout = new ShellLayout
            {
                Location          = this.Location,
                Size              = this.Size,
                WindowState       = this.WindowState,
                NavPaneState      = NaviWorkspace.OptionsNavPane.NavPaneState,
                NavPaintStyleName = NaviWorkspace.PaintStyleName,
                DefaultSkin       = UserLookAndFeel.Default.ActiveSkinName,
                ShowStatusBar     = StatusBar.Visible,
                WindowLayoutMode  = TabbedMdiManager.MdiParent == null ? WindowLayoutMode.Windowed : WindowLayoutMode.Tabbed
            };

            PropertyService.Set <ShellLayout>(UIExtensionSiteNames.Shell_Property_ShellLayout, layout);
        }
Ejemplo n.º 4
0
        /// <summary>
        /// Restores the configuration.
        /// </summary>
        private void RestoreConfiguration()
        {
            // 设置窗口位置
            ShellLayout layout = PropertyService.Get <ShellLayout>(UIExtensionSiteNames.Shell_Property_ShellLayout, null);

            if (layout != null)
            {
                StartPosition    = FormStartPosition.WindowsDefaultLocation;
                this.Location    = layout.Location;
                this.Size        = layout.Size;
                this.WindowState = layout.WindowState;
                this.NaviWorkspace.PaintStyleName = layout.NavPaintStyleName;
                this.NaviWorkspace.OptionsNavPane.NavPaneState = layout.NavPaneState;
                this.StatusBar.Visible          = layout.ShowStatusBar;
                this.TabbedMdiManager.MdiParent = layout.WindowLayoutMode == WindowLayoutMode.Tabbed ? this : null;
                UserLookAndFeel.Default.SetSkinStyle(layout.DefaultSkin);
            }
        }
Ejemplo n.º 5
0
        /// <summary>
        /// Saves this instance.
        /// </summary>
        public void Save()
        {
            ShellLayout layout;

            if (Shell != null)
            {
                layout = new ShellLayout {
                    Location          = Shell.Location,
                    WindowState       = Shell.WindowState,
                    Size              = Shell.Size,
                    ShowStatusBar     = chkShowStatusBar.Checked,
                    DefaultSkin       = cbeSkin.Text,
                    NavPaintStyleName = rgNaviPane.SelectedIndex == 0 ? NAVIBAR_OUTLOOKSTYLE : NAVIBAR_EXPLORERSTYLE,
                    WindowLayoutMode  = rgLayout.SelectedIndex == 0 ? WindowLayoutMode.Tabbed : WindowLayoutMode.Windowed
                };
                ApplySetting(layout); // 应用当前设置
                Property.Current = layout;
                PropertyService.Set <ShellLayout>(UIExtensionSiteNames.Shell_Property_ShellLayout, layout);
                if (SettingChanged != null)
                {
                    SettingChanged(this, new EventArgs <object>(layout)); // 触发事件
                }
            }
        }
        /// <summary>
        /// Ӧ�õ�ǰ����
        /// </summary>
        /// <param name="layout">The layout.</param>
        private void ApplySetting(ShellLayout layout)
        {
            BarManager barManager = WorkItem.RootWorkItem.Items.Get<BarManager>(UIExtensionSiteNames.Shell_Bar_Manager);
            if (barManager != null) {
                Bar bar = barManager.Bars["StatusBar"];
                if (bar != null)
                    bar.Visible = layout.ShowStatusBar;
            }

            XtraNavBarWorkspace naviPane = WorkItem.RootWorkItem.Items.Get<XtraNavBarWorkspace>(UIExtensionSiteNames.Shell_Workspace_NaviPane);
            if (naviPane != null) {
                naviPane.PaintStyleName = layout.NavPaintStyleName;
            }

            XtraTabbedMdiManager mdiManager = WorkItem.RootWorkItem.Items.Get<XtraTabbedMdiManager>(UIExtensionSiteNames.Shell_Manager_TabbedMdiManager);
            if (Shell != null && mdiManager != null) {
                mdiManager.MdiParent = layout.WindowLayoutMode == WindowLayoutMode.Tabbed ? Shell : null;
            }

            UserLookAndFeel.Default.SetSkinStyle(layout.DefaultSkin);
        }
 /// <summary>
 /// Saves this instance.
 /// </summary>
 public void Save()
 {
     ShellLayout layout;
     if (Shell != null) {
         layout = new ShellLayout {
             Location = Shell.Location,
             WindowState = Shell.WindowState,
             Size = Shell.Size,
             ShowStatusBar = chkShowStatusBar.Checked,
             DefaultSkin = cbeSkin.Text,
             NavPaintStyleName = rgNaviPane.SelectedIndex == 0 ? NAVIBAR_OUTLOOKSTYLE : NAVIBAR_EXPLORERSTYLE,
             WindowLayoutMode = rgLayout.SelectedIndex == 0 ? WindowLayoutMode.Tabbed : WindowLayoutMode.Windowed
         };
         ApplySetting(layout); // Ӧ�õ�ǰ����
         Property.Current = layout;
         PropertyService.Set<ShellLayout>(UIExtensionSiteNames.Shell_Property_ShellLayout, layout);
         if (SettingChanged != null)
             SettingChanged(this, new EventArgs<object>(layout)); // �����¼�
     }
 }