Beispiel #1
0
        private void treeView1_DoubleClick(object sender, EventArgs e)
        {
            bool FoundMdiEditor = false;
            var  sel            = treeView1.SelectedNode.FullPath.Replace(Global.CurrentProjectFile.Name + "\\", "");

            if (sel == "Settings\\BuildFile")
            {
                BuildFileEditor bfe = new BuildFileEditor();
                bfe.MdiParent = this.MdiParent;
                bfe.Show();
                return;
            }
            if (!sel.Contains("."))
            {
                return;
            }
            foreach (var i in this.MdiParent.MdiChildren)
            {
                if (i is Editor)
                {
                    if ((i as Editor).FileName == sel)
                    {
                        i.BringToFront();
                        FoundMdiEditor = true;
                    }
                }
            }
            if (!FoundMdiEditor)
            {
                var f = new Editor();
                f.FileName  = sel;
                f.MdiParent = this.MdiParent;
                f.Show();
            }
        }
Beispiel #2
0
        private void treeView1_DoubleClick(object sender, EventArgs e)
        {
            bool FoundMdiEditor = false;
            var sel = treeView1.SelectedNode.FullPath.Replace(Global.CurrentProjectFile.Name + "\\", "");

            if(sel == "Settings\\BuildFile")
            {
                BuildFileEditor bfe = new BuildFileEditor();
                bfe.MdiParent = this.MdiParent;
                bfe.Show();
                return;
            }
            if (!sel.Contains("."))
            {
                return;
            }
            foreach (var i in this.MdiParent.MdiChildren)
            {
                if (i is Editor)
                {
                    if ((i as Editor).FileName == sel)
                    {
                        i.BringToFront();
                        FoundMdiEditor = true;
                    }

                }
            }
            if (!FoundMdiEditor)
            {
                var f = new Editor();
                f.FileName = sel;
                f.MdiParent = this.MdiParent;
                f.Show();
            }
        }