Exemplo n.º 1
0
 private void FilesTabControl_SelectedIndexChanged(object sender, EventArgs e)
 {
     UpdateText();
     if (filesTabControl.SelectedIndex >= 0)
     {
         curFile = files[filesTabControl.SelectedIndex];
         curFile.ShowText(textEditorRichTextBox);
     }
     UpdateFont(currentFont);
 }
Exemplo n.º 2
0
 /// <summary>
 /// Create new file.
 /// </summary>
 /// <param name="sender"></param>
 /// <param name="e"></param>
 private void NewFileMenuItem_Click(object sender, EventArgs e)
 {
     // Set limit for opened files.
     if (files.Count == 10)
     {
         MessageBox.Show("You can open no more than 10 files");
         return;
     }
     try
     {
         UpdateText();
         MyFile file = new MyFile();
         files.Add(file);
         curFile = file;
         curFile.ShowText(textEditorRichTextBox);
         textEditorRichTextBox.Visible = true;
         AddTab($"New document {id++}");
         filesTabControl.SelectedTab = curFile.Page;
     }
     catch
     {
         MessageBox.Show("Error");
     }
 }
Exemplo n.º 3
0
 /// <summary>
 /// Synchronize textbox and curFile.
 /// </summary>
 /// <param name="file"> Fake parameter to set multidelegate. </param>
 private void UpdateCurFile(MyFile file)
 {
     curFile.ShowText(textEditorRichTextBox);
     UpdateTab();
 }