Exemplo n.º 1
0
        /// <summary>
        /// Creates the dock frame and pads.
        /// </summary>
        /// <param name='container'>
        /// Container.
        /// </param>
        private void CreateDockAndPads(HBox container)
        {
            var componentsLibraryPad = new ComponentsLibraryPad();
            var workspaceWindowPad   = new WorkspaceWindowPad();
            var experimentCanvasPad  = new ExperimentCanvasPad(m_applicationContext);
            var outputWindowPad      = new OutputWindowPad();

            IDockPad[] pads = new IDockPad[]
            {
                componentsLibraryPad,
                workspaceWindowPad,
                experimentCanvasPad,
                outputWindowPad
            };

            foreach (IDockPad pad in pads)
            {
                pad.Initialize(m_dockFrame);
            }

            this.ApplicationPads      = pads;
            this.ComponentsLibraryPad = componentsLibraryPad;
            this.WorkspaceWindowPad   = workspaceWindowPad;
            this.ExperimentCanvasPad  = experimentCanvasPad;
            this.OutputWindowPad      = outputWindowPad;

            container.PackStart(m_dockFrame, true, true, 0);

            //TODO: save last layout - see how Pinta has done it
//            string layout_file = System.IO.Path.Combine (PintaCore.Settings.GetUserSettingsDirectory(), "layouts.xml");
//
//            if (System.IO.File.Exists(layout_file))
//            {
//                try
//                {
//                    dock.LoadLayouts(layout_file);
//                }
//                // If parsing layouts.xml fails for some reason, proceed to create the default layout.
//                catch (Exception e)
//                {
//                    System.Console.Error.WriteLine ("Error reading layouts.xml: " + e.ToString());
//                }
//            }

            if (!m_dockFrame.HasLayout("Default"))
            {
                m_dockFrame.CreateLayout("Default", false);
            }

            m_dockFrame.CurrentLayout = "Default";
        }
Exemplo n.º 2
0
        /// <summary>
        /// Creates the dock frame and pads.
        /// </summary>
        /// <param name='container'>
        /// Container.
        /// </param>
        private void CreateDockAndPads(HBox container)
        {
            var componentsLibraryPad = new ComponentsLibraryPad();
            var workspaceWindowPad = new WorkspaceWindowPad();
            var experimentCanvasPad = new ExperimentCanvasPad(m_applicationContext);
            var outputWindowPad = new OutputWindowPad();

            IDockPad[] pads = new IDockPad[] 
                {  
                    componentsLibraryPad,
                    workspaceWindowPad,
                    experimentCanvasPad,
                    outputWindowPad
                };

            foreach(IDockPad pad in pads) 
            {
                pad.Initialize(m_dockFrame);
            }

            this.ApplicationPads = pads;
            this.ComponentsLibraryPad = componentsLibraryPad;
            this.WorkspaceWindowPad = workspaceWindowPad;
            this.ExperimentCanvasPad = experimentCanvasPad;
            this.OutputWindowPad = outputWindowPad;

            container.PackStart(m_dockFrame, true, true, 0);

            //TODO: save last layout - see how Pinta has done it
//            string layout_file = System.IO.Path.Combine (PintaCore.Settings.GetUserSettingsDirectory(), "layouts.xml");
//            
//            if (System.IO.File.Exists(layout_file))
//            {
//                try
//                {
//                    dock.LoadLayouts(layout_file);
//                }
//                // If parsing layouts.xml fails for some reason, proceed to create the default layout.
//                catch (Exception e)
//                {
//                    System.Console.Error.WriteLine ("Error reading layouts.xml: " + e.ToString());
//                }
//            }
            
            if (!m_dockFrame.HasLayout ("Default"))
                m_dockFrame.CreateLayout ("Default", false);
            
            m_dockFrame.CurrentLayout = "Default";
        }