Ejemplo n.º 1
0
        public QueryControl2(WMIScripter parent)
        {
            QueryControl2.CheckForIllegalCrossThreadCalls = false;
            InitializeComponent();
            this.wmiScripterForm = parent;
            this.QueryCondition = new QueryConditionForm(this);
            this.NamespaceCount = 0;

            this.VBScriptCode = new VBScriptCodeGeneration(this, this.wmiScripterForm);
            this.CSharpCode = new CSharpCodeGeneration(this, this.wmiScripterForm);
            this.VBNetCode = new VBNetCodeGeneration(this, this.wmiScripterForm);
            this.PSCode = new PowershellCodeGeneration(this, this.wmiScripterForm);

            this.ClassList.DrawMode = DrawMode.OwnerDrawFixed;
            this.ClassList.DrawItem += new DrawItemEventHandler(this.ClassList_DrawItem);

            this.NamespaceList.DrawMode = DrawMode.OwnerDrawFixed;
            this.NamespaceList.DrawItem += new DrawItemEventHandler(this.NamespaceList_DrawItem);

            this.CodeLanguage.Items.Add(CSHARP);
            this.CodeLanguage.Items.Add(POWERSHELL);
            this.CodeLanguage.Items.Add(VBSCRIPT);
            this.CodeLanguage.Items.Add(VBNET);
            this.CodeLanguage.Text = VBSCRIPT;
        }
Ejemplo n.º 2
0
 //-------------------------------------------------------------------------
 // Handles the event when the ValueButton is clicked. Adds values to the
 // query tab's list of property values.
 //-------------------------------------------------------------------------
 private void ValueButton_Click(object sender, System.EventArgs e)
 {
     this.QueryCondition = new QueryConditionForm(this);
     this.QueryCondition.Show();
 }
Ejemplo n.º 3
0
        //-------------------------------------------------------------------------
        // Handles the event when the namespace is changed on the query tab.
        //
        //-------------------------------------------------------------------------
        private void NamespaceList_SelectedIndexChanged(object sender, System.EventArgs e)
        {
            this.QueryCondition = new QueryConditionForm(this);

            this.ClassList.Text = "";
            this.PropertyList.Items.Clear();
            this.CodeText.Text = "";
            this.ClassStatus.Text = "";
            this.PropertyStatus.Text = "";
            this.ValueButton.Visible = false;

            // Populate the class list.
            this.ClassStatus.Text = "Searching...";
            this.AddClassesToList();
        }
Ejemplo n.º 4
0
        //-------------------------------------------------------------------------
        // Handles the event when the class is changed on the query tab.
        //
        //-------------------------------------------------------------------------
        private void ClassList_SelectedIndexChanged(object sender, System.EventArgs e)
        {
            // Clears out all the other information forms.
            this.QueryCondition = new QueryConditionForm(this);

            this.PropertyList.Items.Clear();
            this.PropertyStatus.Text = "";

            this.CodeText.Text = "";

            this.AddPropertiesToList(null);

            this.ValueButton.Visible = true;
        }