Example #1
0
        private void Button_Click_1(object sender, System.Windows.RoutedEventArgs e)
        {
            IWorkspaceManager manager = WorkspaceManager.GetWorkspaceManager(dockLayoutManager);

            manager.LoadWorkspace(WorkspaceName, LayoutFileName);
            manager.ApplyWorkspace(WorkspaceName);
        }
Example #2
0
        void LoadPredefinedWorkspaces()
        {
            workspaces.Items.Clear();
            Assembly thisExe = typeof(IDEWorkspaces).Assembly;

            for (int i = 1; i <= 4; i++, workspaceNumber++)
            {
                string workspaceName = string.Format("workspace{0}", i);
                string fileName      = string.Format("{0}.xml", workspaceName);
                using (Stream resourceStream = AssemblyHelper.GetEmbeddedResourceStream(thisExe, DemoHelper.GetPath("Layouts/", thisExe) + fileName, true))
                    Manager.LoadWorkspace(workspaceName, resourceStream);
                workspaces.Items.Add(workspaceName);
            }
        }
 void RestoreLayout(string name, Stream file)
 {
     if (useWManagerCheck.IsChecked.HasValue && useWManagerCheck.IsChecked.Value)
     {
         if (transitionComboBox.SelectedItem != null)
         {
             wManager.TransitionEffect = (TransitionEffect)transitionComboBox.SelectedItem;
         }
         wManager.LoadWorkspace(name, file);
         wManager.ApplyWorkspace(name);
     }
     else
     {
         this.barManager.RestoreLayoutFromStream(file);
         ShowMessageBox("Layout has been restored");
     }
 }