Example #1
0
 private void noteViewerToolStripMenuItem_Click(object sender, EventArgs e)
 {
     using (NoteViewerForm form = new NoteViewerForm(MainNoteDirectory))
     {
         form.ShowDialog();
     }
 }
        private void NoteViewerForm_Load(object sender, EventArgs e)
        {
            ThisForm = this;

            mNoteViewingData = new NoteViewingData(mMainNoteDirectory);

            mainDirectoryLabel.Text = mMainNoteDirectory;

            // Set the default class type choice to 'All'
            classTypeSelector.SelectedIndex = 0;

            // Set both from and to dates to tomrrow. This needs to be done to disable date filtering

            // Set semester folders
            if (!string.IsNullOrEmpty(mMainNoteDirectory))
            {
                string[] semesterFolders = new string[] { };

                if (string.IsNullOrEmpty(mMainNoteDirectory))
                {
                    return;
                }
                else
                {
                    semesterFolders = Directory.GetDirectories(mMainNoteDirectory);
                }

                semesterSelector.Items.Clear();

                foreach (string str in semesterFolders)
                {
                    if (str.EndsWith("_s2") || str.EndsWith("_s1"))
                    {
                        semesterSelector.Items.Add(str.Replace(mMainNoteDirectory, ""));
                    }
                }
            }

            template_rtb = template_richTextBox;
            CustomConsole.Log("Set NoteViewerForm.activeRichTextBox to null");
            template_richTextBox.Visible = false;
            CustomConsole.Log("Set the visibility of the NoteViewerForm.template_richTextBox to False");
            mainTabControl.TabPages.RemoveAt(0);
            CustomConsole.Log("Removed the default tab from NoteViewerForm.mainTabControl");

            mainFormTimer.Start();
            ResizeTabControlAndChildren();

            mCurrentFindSearchIndex = 0;
        }