예제 #1
0
        private void addToolStripButton_Click(object sender, EventArgs e)
        {
            EditPerfCounterAlert editPerfCounterAlert = new EditPerfCounterAlert();

            if (editPerfCounterAlert.ShowDialog() == System.Windows.Forms.DialogResult.OK)
            {
                PFConfig.QMPerfCounters.Add(editPerfCounterAlert.SelectedPCInstance);
                RefreshList();
            }
        }
예제 #2
0
 private void addCloneComputerToolStripMenuItem_Click(object sender, EventArgs e)
 {
     if (lvwPerfCounters.SelectedItems.Count > 0)
     {
         EditPerfCounterAlert editPerfCounterAlert = new EditPerfCounterAlert();
         editPerfCounterAlert.InitialMachine = ((QMPerfCounterInstance)lvwPerfCounters.SelectedItems[0].Tag).Computer;
         if (editPerfCounterAlert.ShowDialog() == System.Windows.Forms.DialogResult.OK)
         {
             PFConfig.QMPerfCounters.Add(editPerfCounterAlert.SelectedPCInstance);
             RefreshList();
         }
     }
 }
예제 #3
0
 private void editToolStripButton_Click(object sender, EventArgs e)
 {
     if (lvwPerfCounters.SelectedItems.Count > 0)
     {
         EditPerfCounterAlert editPerfCounterAlert = new EditPerfCounterAlert();
         editPerfCounterAlert.SelectedPCInstance = (QMPerfCounterInstance)lvwPerfCounters.SelectedItems[0].Tag;
         if (editPerfCounterAlert.ShowDialog() == System.Windows.Forms.DialogResult.OK)
         {
             lvwPerfCounters.SelectedItems[0].Tag              = editPerfCounterAlert.SelectedPCInstance;
             lvwPerfCounters.SelectedItems[0].Text             = editPerfCounterAlert.SelectedPCInstance.ToString();
             lvwPerfCounters.SelectedItems[0].SubItems[1].Text = string.Format("{0:f2}", editPerfCounterAlert.SelectedPCInstance.WarningValue);
             lvwPerfCounters.SelectedItems[0].SubItems[2].Text = string.Format("{0:f2}", editPerfCounterAlert.SelectedPCInstance.ErrorValue);
         }
     }
 }