예제 #1
0
        private void ngFile_SaveAs_LinkClicked(object sender, NavBarLinkEventArgs e)
        {
            if (tcMain.SelectedTabPageIndex == -1 || tcMain.SelectedTabPage == null)
            {
                StaticReference.ShowWarning(this, LanguageManager.Get("Message_NoFileOpen"));
                return;
            }
            string fileName = tcMain.SelectedTabPage.Tag as string;

            using (frmSaveAs encSelect = new frmSaveAs(fileName))
            {
                encSelect.ShowDialog();
            }
        }
예제 #2
0
        private void TabContextMenuClick(object sender, EventArgs e)
        {
            ToolStripMenuItem tsmi = sender as ToolStripMenuItem;

            if (null == tsmi)
            {
                return;
            }
            if (tcMain.SelectedTabPageIndex == -1 || tcMain.SelectedTabPage == null)
            {
                StaticReference.ShowWarning(this, LanguageManager.Get("Message_NoFileOpen"));
                return;
            }
            string fileName = tcMain.SelectedTabPage.Tag as string;

            switch (tsmi.Name)
            {
            case "tpcmSave":
            {
                SaveFile(fileName);
            }
            break;

            case "tpcmSaveAs":
                using (frmSaveAs encSelect = new frmSaveAs(fileName))
                {
                    encSelect.ShowDialog();
                }
                break;

            case "tpcmClose":
            {
                if (CloseFile(fileName))
                {
                    var q = tcMain.SelectedTabPage;
                    tcMain.TabPages.Remove(q);        /* */
                    q.Dispose();
                    //.Dispose();
                }
            }
            break;

            case "tpcmCloseAllButThis":
                CloseAll(fileName, CloseAllType.CloseAllButThis);
                break;

            case "tpcmCloseAllToLeft":
                CloseAll(fileName, CloseAllType.CloseAllLeft);
                break;

            case "tpcmCloseAllToRight":
                CloseAll(fileName, CloseAllType.CloseAllRight);
                break;

            case "tpcmCloseAll":
                CloseAll(fileName, CloseAllType.CloseAll);
                break;

            case "tpcmOpenFolder":
            {
                FileInfo fi = new FileInfo(fileName);
                {
                    if (fi.Exists)
                    {
                        Process.Start("explorer.exe", fi.Directory.FullName);
                    }
                }
            }
            break;
            }
        }