Example #1
0
        /// <summary>
        /// Shows or sets the focus to the Project Explorer dock, depending on its current state.
        /// </summary>
        private void ShowProjectExplorer()
        {
            if (projectExplorer != null)
            {
                projectExplorer.Show();
                return;
            }

            projectExplorer = new ProjectExplorer();
            projectExplorer.NodeClick += new EventHandler<NodeClickEventArgs>(ProjectExplorer_NodeClick);
            projectExplorer.NodeDoubleClick += new EventHandler<NodeClickEventArgs>(ProjectExplorer_NodeDoubleClick);
            projectExplorer.NodeRename += new EventHandler<NodeLabelRenameEventArgs>(ProjectExplorer_NodeRename);

            if (IsProjectOpen)
            {
                projectExplorer.Title = projectTitle;
                projectExplorer.ProjectPath = projectPath;
            }
            else
            {
                projectExplorer.Title = projectTitle;
                projectExplorer.ProjectPath = gameFolderPath;
            }

            if (propertiesWindow != null)
            {
                if (propertiesWindow.DockState == DockState.DockRight)
                {
                    projectExplorer.Show(propertiesWindow.Pane, DockAlignment.Top, 0.5);
                    return;
                }
            }

            projectExplorer.Show(dockPanel, DockState.DockRight);
        }
Example #2
0
        private void dockPanel_ContentRemoved(object sender, DockContentEventArgs e)
        {
            if (e.Content.GetType() == typeof(ProjectExplorer))
            {
                projectExplorer = null;
            }
            else if (e.Content.GetType() == typeof(PropertiesWindow))
            {
                propertiesWindow = null;
            }
            else if (e.Content.GetType() == typeof(CodeEditor))
            {
                CodeEditor codeEditor = (CodeEditor)e.Content;

                if (codeEditor.EditorFile != "Untitled")
                {
                    editorDictionary.Remove(codeEditor.EditorFile.ToLower());
                }
            }
        }