public TextEditor(EditorSelectionWindow selectionWindow) { InitializeComponent(); this.selectionWindow = selectionWindow; Timer t = new Timer { Interval = 1 }; t.Tick += (sender, e) => { if (selectedFile == string.Empty) { Text = "TextEditor - No File Selected"; } else if (selectedFile != string.Empty) { Text = "TextEditor - File: " + selectedFile; } currentFont.Text = string.Format("{0}, {1}pt", advancedTextEditor.Font.Name, advancedTextEditor.Font.Size); currentHRuler.Text = string.Format("HRuler: {0}", editor_HRuler ? "ON" : "OFF"); currentShowTabsSpaces.Text = string.Format("Tabs / Spaces: {0}", editor_VisibleSpacesTabs ? "Visible" : "Not Visible"); currentSelectedLineVisible.Text = string.Format("Current Line: {0}", editor_ShowCurrentLine ? "Marked" : "Not Marked"); if (showMenuItemChecked) { editorHRuler.Checked = editor_HRuler; editorVisibleSpacesTabs.Checked = editor_VisibleSpacesTabs; editorShowCurrentLine.Checked = editor_ShowCurrentLine; } else { editorHRuler.Checked = false; editorVisibleSpacesTabs.Checked = false; editorShowCurrentLine.Checked = false; } }; t.Start(); advancedTextEditor.Font = new Font("Roboto", 10f); ini = new Ini(ConfigFile.Path); LoadSettings(); }
public Notepad(EditorSelectionWindow selectionWindow) { InitializeComponent(); this.selectionWindow = selectionWindow; Icon = Icon.FromHandle(Resources.notepadImage.GetHicon()); ListNotes(); #region Random String Generation for (int z = 0; z < 500; z++) { Random rnd = new Random(); string randomNoteName = string.Empty; const string chars = "AaBbCcDdEeFfGgHhIiJjKkLlMmNnOoPpQqRrSsTtUuVvWwXxYyZz0123456789"; randomNoteName = new string(Enumerable.Repeat(chars, 32).Select(s => s[rnd.Next(s.Length)]).ToArray()); randomNoteNames.Add(randomNoteName); } #endregion }
public CodeEditor(EditorSelectionWindow selectionWindow) { InitializeComponent(); this.selectionWindow = selectionWindow; Timer t = new Timer { Interval = 1 }; t.Tick += (sender, e) => { if (selectedFile == string.Empty) { Text = "CodeEditor - No File Selected"; } else if (selectedFile != string.Empty) { Text = "CodeEditor - File: " + selectedFile; } currentFont.Text = string.Format("{0}, {1}pt", advancedEditor.Font.Name, advancedEditor.Font.Size); currentWordWrap.Text = string.Format("WordWrap: {0}", editor_WordWrap ? "Active" : "Inactive"); currentLanguage.Text = string.Format("{0}", advancedEditor.Language); if (showMenuItemsChecked) { editorWordWrap.Checked = editor_WordWrap; btnlangCustom.Checked = lang_Custom; btnlangCSharp.Checked = lang_CSharp; btnlangVisualBasic.Checked = lang_VisualBasic; btnlangHTML.Checked = lang_HTML; btnlangXML.Checked = lang_XML; btnlangSQL.Checked = lang_SQL; btnlangPHP.Checked = lang_PHP; btnlangJS.Checked = lang_JS; btnlangLua.Checked = lang_Lua; } else if (!showMenuItemsChecked) { editorWordWrap.Checked = false; btnlangCustom.Checked = false; btnlangCSharp.Checked = false; btnlangVisualBasic.Checked = false; btnlangHTML.Checked = false; btnlangXML.Checked = false; btnlangSQL.Checked = false; btnlangPHP.Checked = false; btnlangJS.Checked = false; btnlangLua.Checked = false; } }; t.Start(); Icon = Resources.codeIcon; ini = new Ini(ConfigFile.Path); LoadSettings(); }