private void listBox1_DoubleClick(object sender, EventArgs e)
 {
     if (listBox1.SelectedItem != null)
     {
         LogEvent le = (LogEvent)listBox1.SelectedItem;
         if (le.PMR != null)
         {
             if (le.PMR.actualModule != null)
             {
                 try
                 {
                     UserControl uc = le.PMR.actualModule.GetControl();
                     if (uc != null)
                     {
                         ThemedForm f = new ThemedForm();
                         f.Size = new System.Drawing.Size(640, 480);
                         System.Reflection.Assembly target = System.Reflection.Assembly.GetExecutingAssembly();
                         f.Icon = new System.Drawing.Icon(target.GetManifestResourceStream("PassThru.Resources.newIcon.ico"));
                         f.Text = le.PMR.actualModule.adapter.InterfaceInformation.Name + ": " + le.PMR.actualModule.MetaData.Name + " - " + le.PMR.actualModule.MetaData.Version;
                         f.Controls.Add(uc);
                         ColorScheme.SetColorScheme(f);
                         f.Show();
                     }
                 }
                 catch (Exception ne)
                 {
                     LogCenter.WriteErrorLog(ne);
                 }
             }
         }
     }
 }
 private void buttonEnable_Click(object sender, EventArgs e)
 {
     try
     {
         int temp = checkedListBoxModules.SelectedIndex;
         moduleOrder[checkedListBoxModules.SelectedIndex] = new KeyValuePair <bool, string>(!moduleOrder[checkedListBoxModules.SelectedIndex].Key, moduleOrder[checkedListBoxModules.SelectedIndex].Value);
         na.modules.UpdateModuleOrder(moduleOrder);
         moduleOrder = na.modules.GetModuleOrder();
         UpdateView();
         checkedListBoxModules.SelectedIndex = temp;
     }
     catch (Exception ne)
     {
         LogCenter.WriteErrorLog(ne);
     }
 }
 /// <summary>
 /// Builds the module Help window
 /// </summary>
 /// <param name="sender"></param>
 /// <param name="e"></param>
 private void buttonHelp_Click(object sender, EventArgs e)
 {
     try
     {
         ThemedForm f = new ThemedForm();
         f.Size = new System.Drawing.Size(640, 480);
         System.Reflection.Assembly target = System.Reflection.Assembly.GetExecutingAssembly();
         f.Icon = new System.Drawing.Icon(target.GetManifestResourceStream("PassThru.Resources.newIcon.ico"));
         f.Text = "Help";
         Help uc = new Help(checkedListBoxModules.SelectedItem);
         uc.Dock = DockStyle.Fill;
         f.Controls.Add(uc);
         ColorScheme.SetColorScheme(f);
         f.Show();
     }
     catch (Exception ne)
     {
         LogCenter.WriteErrorLog(ne);
     }
 }
 private void buttonMoveDown_Click(object sender, EventArgs e)
 {
     try
     {
         if (checkedListBoxModules.SelectedIndex != moduleOrder.Count - 1)
         {
             KeyValuePair <bool, string> temp = moduleOrder[checkedListBoxModules.SelectedIndex];
             moduleOrder.RemoveAt(checkedListBoxModules.SelectedIndex);
             moduleOrder.Insert(checkedListBoxModules.SelectedIndex + 1, temp);
             na.modules.UpdateModuleOrder(moduleOrder);
             moduleOrder = na.modules.GetModuleOrder();
             int newIndex = checkedListBoxModules.SelectedIndex + 1;
             UpdateView();
             checkedListBoxModules.SelectedIndex = newIndex;
         }
     }
     catch (Exception ne)
     {
         LogCenter.WriteErrorLog(ne);
     }
 }
 private void buttonOpenConfiguration_Click(object sender, EventArgs e)
 {
     try
     {
         UserControl uc = na.modules.GetModule(checkedListBoxModules.SelectedIndex).GetControl();
         if (uc != null)
         {
             ThemedForm f = new ThemedForm();
             f.Size = new System.Drawing.Size(640, 480);
             System.Reflection.Assembly target = System.Reflection.Assembly.GetExecutingAssembly();
             f.Icon = new System.Drawing.Icon(target.GetManifestResourceStream("PassThru.Resources.newIcon.ico"));
             f.Text = na.InterfaceInformation.Name + ": " + na.modules.GetModule(checkedListBoxModules.SelectedIndex).MetaData.Name + " - " + na.modules.GetModule(checkedListBoxModules.SelectedIndex).MetaData.Version;
             f.Controls.Add(uc);
             ColorScheme.SetColorScheme(f);
             f.Show();
         }
     }
     catch (Exception ne)
     {
         LogCenter.WriteErrorLog(ne);
     }
 }