Esempio n. 1
0
 /// <summary>
 /// Save all files automatically.
 /// </summary>
 /// <param name="sender"></param>
 /// <param name="e"></param>
 private void AutoSave(object sender, EventArgs e)
 {
     foreach (TabPage tab in tabControl.TabPages)
     {
         EditorTab editorTab = tab as EditorTab;
         if (editorTab != null)
         {
             editorTab.AutoSave();
         }
     }
 }
Esempio n. 2
0
 /// <summary>
 /// Save current file.
 /// </summary>
 /// <param name="sender"></param>
 /// <param name="e"></param>
 private void Save(object sender, EventArgs e)
 {
     if (tabControl.SelectedTab != null)
     {
         EditorTab tab = tabControl.SelectedTab as EditorTab;
         if (tab != null)
         {
             tab.SaveFile();
         }
     }
 }
Esempio n. 3
0
 /// <summary>
 /// Choose font for current tab.
 /// </summary>
 /// <param name="sender"></param>
 /// <param name="e"></param>
 private void Format(object sender, EventArgs e)
 {
     if (tabControl.SelectedTab != null)
     {
         EditorTab tab = tabControl.SelectedTab as EditorTab;
         if (tab != null)
         {
             FontDialog dialog = new FontDialog();
             dialog.Font = tab.editor.EditorTextBox.SelectionFont;
             dialog.ShowDialog();
             tab.editor.EditorTextBox.SelectionFont = dialog.Font;
         }
     }
 }
Esempio n. 4
0
 /// <summary>
 /// Apply changes in ui colors.
 /// </summary>
 /// <param name="sender"></param>
 /// <param name="e"></param>
 private void NotepadForm_Activated(object sender, EventArgs e)
 {
     this.BackColor = settings.color3;
     this.ForeColor = settings.color2;
     foreach (Control item in this.Controls)
     {
         item.BackColor = settings.color3;
         item.ForeColor = settings.color2;
     }
     foreach (TabPage tab in tabControl.TabPages)
     {
         foreach (Control item in tab.Controls)
         {
             item.BackColor = settings.color1;
             item.ForeColor = settings.color2;
         }
         EditorTab editorTab = tab as EditorTab;
         if (editorTab != null)
         {
             editorTab.editor.EditorTextBox.BackColor = settings.color1;
             editorTab.editor.EditorTextBox.ForeColor = settings.color2;
         }
     }
 }
Esempio n. 5
0
        /// <summary>
        /// Create new tab.
        /// </summary>
        private void NewTab(object sender, EventArgs e)
        {
            EditorTab newTab = new EditorTab("Новый файл", settings);

            tabControl.TabPages.Add(newTab);
        }