private void CreateScriptToolStripBt_Click(object sender, EventArgs e) { NewMenuItem.PerformClick(); }
private void getSettings() { bool wordWrap = Properties.Settings.Default.WordWrap; Font font = Properties.Settings.Default.Font; Point mainLocation = Properties.Settings.Default.MainLocation; Size mainSize = Properties.Settings.Default.MainSize; bool isMaximized = Properties.Settings.Default.isMaximized; bool showStatusBar = Properties.Settings.Default.StatusBar; RightToLeft rightToLeft = Properties.Settings.Default.ReadRighLeft; float zoomFactor = Properties.Settings.Default.ZoomFactor; string lastFile = Properties.Settings.Default.LastOpenedFile; MenuCheck(ShowStatusBarMenuItem, showStatusBar); MenuCheck(ShowStatusBarCtxMenu, showStatusBar); MenuCheck(ReadRighToLeftCtxMenu, mainLib.rightToLeftToBool(rightToLeft)); MenuCheck(WordWrapMenuItem, wordWrap); statusBarCtxMenu.RightToLeft = RightToLeft.No; textBox.ZoomFactor = zoomFactor; textBox.Font = font; if (isMaximized) { WindowState = FormWindowState.Maximized; } else { Size = mainSize; WindowState = FormWindowState.Normal; } if (isNewWindow || mainLocation == new Point(0, 0)) { StartPosition = FormStartPosition.WindowsDefaultLocation; } else { Location = mainLocation; } List <string> tempList = getRecentFiles(); if (tempList.Count > 0) { for (int i = 0; i < tempList.Count; i++) { addRecentFile(tempList[i]); } } if (string.IsNullOrEmpty(currentFile)) { if (!string.IsNullOrEmpty(lastFile) && !isNewWindow && File.Exists(lastFile)) { openFile(lastFile); } else { NewMenuItem.PerformClick(); } } else { openFile(currentFile); } // Fix SaveMark issue textBoxChangedEvent(null, null); isSaved = true; }