private void uxLstView_Items_DoubleClick(object sender, EventArgs e) { // Get the selected Property / Method / Qualifier's name string itemName = uxLstView_Items.SelectedItems[0].SubItems[0].Text; WbemClient cl = Form1.Client; CimInstanceName name = (CimInstanceName)uxLstView_Items.SelectedItems[0].Tag; GetInstanceOpSettings io = new GetInstanceOpSettings(name); io.LocalOnly = false; io.IncludeClassOrigin = false; io.IncludeQualifiers = false; CimInstance instance = cl.GetInstance(io); CimInstanceForm tmpForm = new CimInstanceForm(instance); if (tmpForm.ShowDialog() == DialogResult.OK) { cl.ModifyInstance(tmpForm.DisplayInstance); } }
private void ctxCreateInstance_Click(object sender, EventArgs e) { CimInstance newInstance = mainWbemClient.CreateTemplateInstance(treeView1.SelectedNode.Text); CimInstanceForm tmpForm = new CimInstanceForm(newInstance); if (tmpForm.ShowDialog() == DialogResult.OK) { mainWbemClient.CreateInstance(newInstance); // Force an update if it's on the Instances Tab if (uxtabControl.SelectedIndex == 1) uxtabControl_SelectedIndexChanged(null, null); } }