private void OnSelectClass(Object source, EventArgs args)
        {
            try
            {
                StringTable strs = new StringTable(50);

                SelectWMIClassTreeDialog selectClassDlg = new SelectWMIClassTreeDialog(
                    serverName,
                    ClassFilters.ConcreteData,
                    //SchemaFilters.NoEvent|SchemaFilters.NoAbstract|	SchemaFilters.NoSystem |SchemaFilters.NoAssoc,
                    strs);


                DialogResult ret = ((SelectWMIClassTreeDialog)selectClassDlg).ShowDialog();

                if (ret != DialogResult.OK)
                {
                    return;
                }

                String selClass = ((SelectWMIClassTreeDialog)selectClassDlg).SelectedClasses.ToArray()[0];
                targetClassBox.Text = selClass;


                QueryText.Text = "SELECT * FROM " + EventName + " WITHIN " + pollingIntervalBox.Text +
                                 " WHERE TargetInstance ISA \"" + ClassName + "\"";
            }
            catch (Exception exc)
            {
                MessageBox.Show(WMISys.GetString("WMISE_Exception", exc.Message, exc.StackTrace));
            }
        }
        private void OnSelectClass(Object source, EventArgs args)
        {
            try
            {
                StringTable strs = new StringTable(50);

                SelectWMIClassTreeDialog selectClassDlg = new SelectWMIClassTreeDialog(
                    serverName,
                    ClassFilters.ExtrinsicEvents,
                    //SchemaFilters.NoSystem |SchemaFilters.NoAssoc,
                    strs);


                DialogResult ret = ((SelectWMIClassTreeDialog)selectClassDlg).ShowDialog();

                if (ret != DialogResult.OK)
                {
                    return;
                }

                String selClass = ((SelectWMIClassTreeDialog)selectClassDlg).SelectedClasses.ToArray()[0];
                eventClassBox.Text = selClass;

                if (grid != null)
                {
                    this.Controls.Remove(grid);
                    grid = null;
                }

                grid = new WMIObjectGrid(WmiHelper.GetClassObject(serverName, NS, ClassName),
                                         PropertyFilters.NoSystem,
                                         GridMode.EditMode,
                                         true, false, false);

                grid.Location             = new Point(16, 70);
                grid.Size                 = (Size) new Point(368, 180);
                grid.Anchor               = AnchorStyles.All;
                grid.PreferredColumnWidth = 90;
                grid.PreferredRowHeight   = 19;
                grid.TabIndex             = 3;
                ((DataTable)grid.DataSource).RowChanging += new DataRowChangeEventHandler(this.GridRowChanging);

                this.Controls.Add(grid);

                QueryText.Text = "SELECT * FROM " + ClassName;
            }
            catch (Exception exc)
            {
                MessageBox.Show(WMISys.GetString("WMISE_Exception", exc.Message, exc.StackTrace));
            }
        }