コード例 #1
0
        public override IMyGenDocument Open(IMyGenerationMDI mdi, FileInfo file, params string[] args)
        {
            ProjectBrowser edit = null;

            if (file.Exists)
            {
                bool isopen = mdi.IsDocumentOpen(file.FullName);

                if (!isopen)
                {
                    edit = new ProjectBrowser(mdi);
                    edit.LoadProject(file.FullName);
                }
                else
                {
                    edit = mdi.FindDocument(file.FullName) as ProjectBrowser;
                    if (edit != null)
                    {
                        edit.Activate();
                    }
                }
            }

            return edit;
        }
コード例 #2
0
        public override IMyGenDocument Open(IMyGenerationMDI mdi, FileInfo file, params string[] args)
        {
            ProjectBrowser edit = null;

            if (file.Exists)
            {
                bool isopen = mdi.IsDocumentOpen(file.FullName);

                if (!isopen)
                {
                    edit = new ProjectBrowser(mdi);
                    edit.LoadProject(file.FullName);
                }
                else
                {
                    edit = mdi.FindDocument(file.FullName) as ProjectBrowser;
                    if (edit != null)
                    {
                        edit.Activate();
                    }
                }
            }

            return(edit);
        }
コード例 #3
0
        public override IMyGenDocument Create(IMyGenerationMDI mdi, params string[] args)
        {
            ProjectBrowser edit = new ProjectBrowser(mdi);

            switch (args[0])
            {
            case ProjectEditorManager.MYGEN_PROJECT:
            default:
                edit.CreateNewProject();
                break;
            }

            return(edit);
        }
コード例 #4
0
        public override IMyGenDocument Create(IMyGenerationMDI mdi, params string[] args)
        {
            ProjectBrowser edit = new ProjectBrowser(mdi);

            switch (args[0])
            {
                case ProjectEditorManager.MYGEN_PROJECT:
                default:
                    edit.CreateNewProject();
                    break;
            }

            return edit;
        }
コード例 #5
0
        private ProjectBrowser OpenProjectEditor(string filename)
        {
            ProjectBrowser proj = null;

            bool isopen = IsProjectOpen(filename);

            if (!isopen)
            {
                proj = new ProjectBrowser(this);
                proj.LoadProject(filename);
                proj.Show(dockManager);
            }

            return proj;
        }
コード例 #6
0
        private ProjectBrowser OpenProjectEditor()
        {
            ProjectBrowser proj = new ProjectBrowser(this);
            proj.CreateNewProject();
            proj.Show(dockManager);

            return proj;
        }
コード例 #7
0
        public ProjectBrowser GetProjectBrowser(string filename, ProjectBrowser exclude)
        {
            ProjectBrowser editor = null;

            FileInfo inf = new FileInfo(filename);
            string tmp = inf.FullName;
            foreach (DockContent cont in dockManager.Contents)
            {
                if ((cont is ProjectBrowser) && (cont != exclude))
                {
                    editor = cont as ProjectBrowser;
                    if (tmp.ToUpper() == editor.CompleteFilePath.ToUpper())
                    {
                        break;
                    }
                    else
                    {
                        editor = null;
                    }
                }
            }
            return editor;
        }
コード例 #8
0
 public bool IsProjectOpen(string filename, ProjectBrowser exclude)
 {
     ProjectBrowser editor = GetProjectBrowser(filename, exclude);
     return (editor != null);
 }