Esempio n. 1
0
 /*
  * If the listbox selection is changed and it is not nothing it will underline keywords.
  */
 private void MainForm_SelectedIndexChanged(object sender, EventArgs e)
 {
     if (Listbox_SearchCount.getListBox().SelectedIndex > -1)
     {
         UnderlineSelectedKeyword(KeywordFrequencies[Listbox_SearchCount.getListBox().SelectedIndex].Keyword.ToLower());
     }
 }
Esempio n. 2
0
 /*
  * Loops through the KeywordFrequencies list, adding each one to the Listbox with the
  * number of times it appears next to it.
  */
 private void AddKeywordsToListbox()
 {
     KeywordFrequencies = SortListByFrequency(KeywordFrequencies);
     Listbox_SearchCount.getListBox().Items.Clear();
     foreach (KeywordFrequency keyword in KeywordFrequencies)
     {
         Listbox_SearchCount.getListBox().Items.Add(keyword.Keyword + " (" + keyword.Frequency + ")");
     }
 }
Esempio n. 3
0
        public MainForm()
        {
            InitializeComponent();

            // Event whenever the text is changed, to know when the email has been edited by the user
            RichTextbox_MainText.getTextbox().TextChanged += new EventHandler(MainForm_RichTextbox_TextChanged);

            Listbox_SearchCount.getListBox().SelectedIndexChanged += new EventHandler(MainForm_SelectedIndexChanged);
        }
Esempio n. 4
0
 /*
  * Removes the red font on the keywords and clears the listbox of items.
  * Sets the previous email text to the current email text.
  */
 private void MainForm_RichTextbox_TextChanged(object sender, EventArgs e)
 {
     if (RichTextbox_MainText.getTextbox().Text != PrevMainText)
     {
         Listbox_SearchCount.getListBox().Items.Clear();
         SetMainTextDefaultColour();
         PrevMainText = RichTextbox_MainText.getTextbox().Text;
     }
 }
Esempio n. 5
0
 /*
  * Clears the text in the keywords textbox.
  */
 private void Button_ClearKeywords_Click(object sender, EventArgs e)
 {
     Textbox_Keywords.getTextbox().Text = String.Empty;
     Listbox_SearchCount.getListBox().Items.Clear();
     SetMainTextDefaultColour();
 }
Esempio n. 6
0
 /*
  * Clears the text in the email textbox.
  */
 private void Button_ClearMainText_Click(object sender, EventArgs e)
 {
     RichTextbox_MainText.getTextbox().Text = String.Empty;
     Listbox_SearchCount.getListBox().Items.Clear();
 }