Exemple #1
0
 private void editToolStripButton_Click(object sender, EventArgs e)
 {
     if (lvwQueries.SelectedItems.Count > 0 && lvwQueries.SelectedItems[0].Tag is RegistryQueryInstance)
     {
         EditRegistryQueryInstance editQueryInstance = new EditRegistryQueryInstance();
         editQueryInstance.SelectedRegistryQueryInstance = (RegistryQueryInstance)lvwQueries.SelectedItems[0].Tag;
         if (editQueryInstance.ShowDialog() == System.Windows.Forms.DialogResult.OK)
         {
             ListViewItem lvi = lvwQueries.SelectedItems[0];
             lvi.Text             = editQueryInstance.SelectedRegistryQueryInstance.Name;
             lvi.SubItems[1].Text = (editQueryInstance.SelectedRegistryQueryInstance.UseRemoteServer ? editQueryInstance.SelectedRegistryQueryInstance.Server + "\\" : "") + RegistryQueryInstance.GetRegistryHiveFromString(editQueryInstance.SelectedRegistryQueryInstance.RegistryHive.ToString()).ToString() + "\\" + editQueryInstance.SelectedRegistryQueryInstance.Path;
             lvi.SubItems[2].Text = editQueryInstance.SelectedRegistryQueryInstance.KeyName;
             lvi.SubItems[3].Text = editQueryInstance.SelectedRegistryQueryInstance.SuccessValue;
             lvi.SubItems[4].Text = editQueryInstance.SelectedRegistryQueryInstance.WarningValue;
             lvi.SubItems[5].Text = editQueryInstance.SelectedRegistryQueryInstance.ErrorValue;
             lvi.Tag = editQueryInstance.SelectedRegistryQueryInstance;
         }
     }
 }
Exemple #2
0
        private void addToolStripButton_Click(object sender, EventArgs e)
        {
            EditRegistryQueryInstance editQueryInstance = new EditRegistryQueryInstance();

            editQueryInstance.SelectedRegistryQueryInstance = new RegistryQueryInstance();
            if (editQueryInstance.ShowDialog() == System.Windows.Forms.DialogResult.OK)
            {
                ListViewItem lvi = new ListViewItem(editQueryInstance.SelectedRegistryQueryInstance.Name);
                lvi.SubItems.Add((editQueryInstance.SelectedRegistryQueryInstance.UseRemoteServer ? editQueryInstance.SelectedRegistryQueryInstance.Server + "\\" : "") + RegistryQueryInstance.GetRegistryHiveFromString(editQueryInstance.SelectedRegistryQueryInstance.RegistryHive.ToString()).ToString() + "\\" + editQueryInstance.SelectedRegistryQueryInstance.Path);
                lvi.SubItems.Add(editQueryInstance.SelectedRegistryQueryInstance.KeyName);
                lvi.SubItems.Add(editQueryInstance.SelectedRegistryQueryInstance.SuccessValue);
                lvi.SubItems.Add(editQueryInstance.SelectedRegistryQueryInstance.WarningValue);
                lvi.SubItems.Add(editQueryInstance.SelectedRegistryQueryInstance.ErrorValue);
                lvi.Tag = editQueryInstance.SelectedRegistryQueryInstance;
                lvwQueries.Items.Add(lvi);
                CheckOKEnabled();
                CheckButtonsEnable();
            }
        }