예제 #1
0
 public void CloseTabByTab(TabCodeInfo tabId)
 {
     if (tabCodeInfo.Contains(tabId))
     {
         int index = tabCodeInfo.IndexOf(tabId);
         CloseTab(index);
         GC.Collect();
     }
 }
예제 #2
0
        private void Explorer_DoubleClick(object sender, EventArgs e)
        {
            TreeView    treeView   = sender as TreeView;
            TabCodeInfo choosenTab = treeView.SelectedNode.Tag as CodeStudio.TabCodeInfo;

            if (!Singletones.codeWindow.IsOpened(choosenTab.path))
            {
                Singletones.codeWindow.LoadFileFromExplorer(choosenTab);
            }
        }
예제 #3
0
 private void toolStripMenuItem2_Click(object sender, EventArgs e)
 {
     if (ClickOnNode)
     {
         TabCodeInfo choosenTab = Explorer.SelectedNode.Tag as CodeStudio.TabCodeInfo;
         if (choosenTab != null)
         {
             Singletones.codeWindow.CloseTabByTab(choosenTab);
             Explorer.SelectedNode.Remove();
         }
         ClickOnNode = false;
     }
 }
예제 #4
0
 private void toolStripMenuItem1_Click(object sender, EventArgs e)
 {
     if (ClickOnNode)
     {
         TabCodeInfo choosenTab = Explorer.SelectedNode.Tag as CodeStudio.TabCodeInfo;
         if (choosenTab != null)
         {
             if (!Singletones.codeWindow.IsOpened(choosenTab.path))
             {
                 Singletones.codeWindow.LoadFileFromExplorer(choosenTab);
             }
         }
         ClickOnNode = false;
     }
 }
예제 #5
0
        void CrateTabInTAbControl(TabCodeInfo codeInfo)
        {
            TabPage tab = new TabPage();

            tab.BackColor = Singletones.settings.DefaultBackground;
            tab.ForeColor = Singletones.settings.DefaultForeground;
            tab.Controls.Add(codeInfo.tab);
            tab.Name = tab.Text = codeInfo.name;
            tabControl.Controls.Add(tab);
            tab.TextChanged += delegate(object s, System.EventArgs args) {
                codeInfo.solutionExprorerNode.Text = tab.Text;
            };

            tabControl.SelectedIndex = tabControl.TabCount - 1;
        }
예제 #6
0
        void CreateTab(string pathArg, CodeTemplateInfo codeTemplateInfo)
        {
            if (IsOpened(pathArg))
            {
                return;
            }

            TabCodeInfo codeInfo = new TabCodeInfo(pathArg, codeTemplateInfo);

            codeInfo.tab.TextChanged += delegate(object s, System.EventArgs args) {
                AddOrRemAsteriksToName();

                void AddOrRemAsteriksToName()
                {
                    if (tabControl.SelectedIndex != -1)
                    {
                        if (tabCodeInfo[tabControl.SelectedIndex].name[tabCodeInfo[tabControl.SelectedIndex].name.Length - 1] != '*')
                        {
                            tabCodeInfo[tabControl.SelectedIndex].name   += "*";
                            tabCodeInfo[tabControl.SelectedIndex].isSaved = false;
                        }
                    }
                    SetTabTextToRichBoxNames();
                }
            };

            tabCodeInfo.Add(codeInfo);

            TreeNode solutionNode = new TreeNode(codeInfo.name)
            {
                Tag = codeInfo
            };

            solutionNode.Tag = codeInfo;
            codeInfo.solutionExprorerNode = solutionNode;

            CrateTabInTAbControl(codeInfo);

            tabControl.SelectedIndex = tabControl.TabCount - 1;

            Singletones.rightWindow.Explorer.Nodes.Add(solutionNode);

            codeInfo.syntaxChecker?.HighlightText(codeInfo.tab);
        }
예제 #7
0
 public void LoadFileFromExplorer(TabCodeInfo codeInfo)
 {
     tabCodeInfo.Add(codeInfo);
     CrateTabInTAbControl(codeInfo);
 }