示例#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;
        }
示例#2
0
        public MethodControl2(WMIScripter parent)
        {
            InitializeComponent();
            this.NamespaceCount = 0;
            this.wmiScripterForm = parent;

            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.MethodList.DrawMode = DrawMode.OwnerDrawFixed;
            this.MethodList.DrawItem += new DrawItemEventHandler(MethodList_DrawItem);

            this.InstanceList.DrawMode = DrawMode.OwnerDrawFixed;
            this.InstanceList.DrawItem += new DrawItemEventHandler(InstanceList_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;

            this.InitialAddClassesToList();
        }
        public ExploreWmiControl(WMIScripter parent)
        {
            ExploreWmiControl.CheckForIllegalCrossThreadCalls = false;
            InitializeComponent();
            this.wmiScripterForm = parent;
            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.CodeLanguage.Items.Add(CSHARP);
            this.CodeLanguage.Items.Add(POWERSHELL);
            this.CodeLanguage.Items.Add(VBSCRIPT);
            this.CodeLanguage.Items.Add(VBNET);
            this.CodeLanguage.Text = VBSCRIPT;

            this.Symbols = new ImageList();

            System.Reflection.Assembly a = System.Reflection.Assembly.Load("WMIScripter");
            Stream str = a.GetManifestResourceStream("WMIScripter.Art.ClassIcon.png");
            this.Symbols.Images.Add("classSymbol", new System.Drawing.Bitmap(str));
            str = a.GetManifestResourceStream("WMIScripter.Art.NamespaceIcon.png");
            this.Symbols.Images.Add("namespaceSymbol", new System.Drawing.Bitmap(str));
            str = a.GetManifestResourceStream("WMIScripter.Art.MethodIcon.png");
            this.Symbols.Images.Add("methodSymbol", new System.Drawing.Bitmap(str));
            str = a.GetManifestResourceStream("WMIScripter.Art.PropertyIcon.png");
            this.Symbols.Images.Add("propertySymbol", new System.Drawing.Bitmap(str));
            this.wmiTreeView.ImageList = Symbols;
            str.Close();
        }
示例#4
0
        public EventControl2(WMIScripter parent)
        {
            InitializeComponent();
            this.NamespaceCount = 0;
            this.QueryCounter = 0;
            this.wmiScripterForm = parent;

            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.TargetInstanceList.DrawMode = DrawMode.OwnerDrawFixed;
            this.TargetInstanceList.DrawItem += new DrawItemEventHandler(TargetInstanceList_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;

            // Holds the event queries that are supported by event providers.
            SupportedEventQueries = new string[MAXEVENTQUERIES];
            SupportedEventQueries.Initialize();

            this.InitialAddClassesToList();
            this.Asynchronous.Visible = false;
        }
        //-------------------------------------------------------------------------
        // Constructor for the TargetComputerWindow class. This constructor
        // creates a pointer to the parent WMIScripter form.
        //-------------------------------------------------------------------------
        public TargetComputerWindow(WMIScripter form)
        {
            this.controlWindow = form;

            InitializeComponent();
        }
示例#6
0
        // Required designer variable.
        //-------------------------------------------------------------------------
        // Generates the Search form, and initializes all the components on the form.
        //
        //-------------------------------------------------------------------------
        public SearchForm2(WMIScripter parentInstance)
        {
            // Required for Windows Form Designer support
            InitializeComponent();

            this.searchThread = null;

            //
            // Set properties of the derived statusbar.
            //
            this.StatusBar = new ProgressStatus();
            this.pnl1 = new System.Windows.Forms.StatusBarPanel();
            this.pnlProgress = new System.Windows.Forms.StatusBarPanel();
            ((System.ComponentModel.ISupportInitialize)(this.pnl1)).BeginInit();
            ((System.ComponentModel.ISupportInitialize)(this.pnlProgress)).BeginInit();
            this.SuspendLayout();
            //
            // statusBar
            //
            this.StatusBar.Location = new System.Drawing.Point(0, 407);
            this.StatusBar.Name = "statusBar";
            this.StatusBar.Panels.AddRange(new System.Windows.Forms.StatusBarPanel[] { this.pnl1, this.pnlProgress });
            this.StatusBar.ShowPanels = true;
            this.StatusBar.Size = new System.Drawing.Size(584, 22);
            this.StatusBar.TabIndex = 0;
            //
            // pnl1
            //
            this.pnl1.MinWidth = 200;
            //
            // pnlProgress
            //
            this.pnlProgress.AutoSize =
                  System.Windows.Forms.StatusBarPanelAutoSize.Spring;
            this.pnlProgress.Style =
                  System.Windows.Forms.StatusBarPanelStyle.OwnerDraw;
            this.pnlProgress.Width = 468;

            this.Controls.Add(this.StatusBar);
            ((System.ComponentModel.ISupportInitialize)(this.pnl1)).EndInit();
            ((System.ComponentModel.ISupportInitialize)(this.pnlProgress)).EndInit();
            this.ResumeLayout(false);

            this.StatusBar.setProgressBarPanel = 1;
            this.StatusBar.Panels[0].Text = "Ready";
            this.StatusBar.HideProgress();

            this.wmiScripter = parentInstance;

            clickMenu = new ContextMenu();
            QueryMenuItem = new MenuItem("Generate code to query property values.");
            QueryMenuItem.Click += new EventHandler(QueryMenuItem_Click);
            MethodMenuItem = new MenuItem("Generate code to execute methods.");
            MethodMenuItem.Click += new EventHandler(MethodMenuItem_Click);
            EventMenuItem = new MenuItem("Generate code to receive events from this class.");
            EventMenuItem.Click += new EventHandler(EventMenuItem_Click);
            ExploreMenuItem = new MenuItem("Generate code to explore the selected object.");
            ExploreMenuItem.Click += new EventHandler(ExploreMenuItem_Click);

            this.NormalTextFont = new Font("Arial", 11, FontStyle.Regular);
            this.HeadingTextFont = new Font("Arial", 13, FontStyle.Bold);
            this.LinkTextFont = new Font("Arial", 13, FontStyle.Underline);

            this.TextToSearchFor = "";

            this.ResultsGridView.ShowCellToolTips = false;

            // Create a background image for the top of the form.
            System.Reflection.Assembly a = System.Reflection.Assembly.Load("WMIScripter");
            Stream str = a.GetManifestResourceStream("WMIScripter.Art.searchBackground.png");
            this.TopPanel.BackgroundImage = new System.Drawing.Bitmap(str);
            str.Close();
        }