Example #1
0
    private void ExportBlacklists(BlacklistModel blacklistModel)
    {
        IImportExport importExport = new ImportExport();

        importExport.WriteDataToXmlFile(blacklistModel,
                                        Path.Combine(AppDomain.CurrentDomain.BaseDirectory, "Blacklist.xml"));
        MessageBox.Show(Resources.BlacklistSavedTest, Resources.BlacklistSavedCaption, MessageBoxButtons.OK,
                        MessageBoxIcon.Information);
    }
Example #2
0
 private void LoadBlacklists()
 {
     try
     {
         if (!File.Exists(Path.Combine(AppDomain.CurrentDomain.BaseDirectory, "Blacklist.xml")))
         {
             return;
         }
         IImportExport importExport = new ImportExport();
         _blacklistModel =
             importExport.LoadConfigFromXmlFile(Path.Combine(AppDomain.CurrentDomain.BaseDirectory, "Blacklist.xml"));
         LoadDataToCombobox(_blacklistModel);
     }
     catch (Exception ex)
     {
         MessageBox.Show(ex.StackTrace, ex.Message, MessageBoxButtons.OK, MessageBoxIcon.Error);
     }
 }
Example #3
0
 private void BlacklistDialog_Load(object sender, EventArgs e)
 {
     try
     {
         if (!File.Exists(Path.Combine(AppDomain.CurrentDomain.BaseDirectory, "Blacklist.xml")))
         {
             return;
         }
         IImportExport importExport   = new ImportExport();
         var           blacklistModel =
             importExport.LoadConfigFromXmlFile(Path.Combine(AppDomain.CurrentDomain.BaseDirectory, "Blacklist.xml"));
         LoadDataToTable(blacklistModel);
     }
     catch (Exception ex)
     {
         MessageBox.Show(ex.StackTrace, ex.Message, MessageBoxButtons.OK, MessageBoxIcon.Error);
     }
 }