Beispiel #1
0
 private void GetAlerts()
 {
     if (Properties.Settings.Default.Alerts != null && Properties.Settings.Default.Alerts.Count > 0)
     {
         foreach (String system in Properties.Settings.Default.Alerts)
         {
             String[] alertparts = system.Split('|');
             if (alertparts.Length == lvwAlerts.Columns.Count)
             {
                 ListViewItem lvwItm = new ListViewItem();
                 lvwItm.Text = alertparts[0];
                 for (int idx = 1; idx < alertparts.Length; idx++)
                 {
                     lvwItm.SubItems.Add(alertparts[idx]);
                 }
                 PShell.psmethods.PSAlert alert = new PShell.psmethods.PSAlert(this);
                 lvwItm.ImageIndex = (int)alert.GetAlertTypeFromString(alertparts[0]);
                 alert = null;
                 lvwAlerts.Items.Add(lvwItm);
                 alerts.Add(lvwItm);
             }
         }
         lvwAlerts_Update();
         Properties.Settings.Default["Alerts"] = new System.Collections.Specialized.StringCollection();
         ((System.Collections.Specialized.StringCollection)Properties.Settings.Default["Alerts"]).Clear();
         Properties.Settings.Default.Save();
         Properties.Settings.Default.Reload();
     }
 }