Пример #1
0
        /// <summary>
        /// Insert the clicked token in the rich text box.
        /// </summary>
        /// <param name="sender">The sender.</param>
        /// <param name="e">The <see cref="System.EventArgs"/> instance containing the event data.</param>
        private void InsertToken(object sender, EventArgs e)
        {
            ToolStripButton button = sender as ToolStripButton;

            if (button != null)
            {
                switch (button.Text)
                {
                case Tokens.WMIData:
                    using (WMIQueryForm WQF = new WMIQueryForm())
                    {
                        if (WQF.ShowDialog() == System.Windows.Forms.DialogResult.OK)
                        {
                            LayoutRichTextBox.SelectedText = Program.WrapTokenKey(TokenIDs.WMIData + "[" + WQF.listQueries.SelectedItem + "]");
                        }
                        WQF.Close();
                    }
                    break;

                case Tokens.WSHScript:
                    using (WSHScriptForm WSHF = new WSHScriptForm())
                    {
                        if (WSHF.ShowDialog() == System.Windows.Forms.DialogResult.OK)
                        {
                            LayoutRichTextBox.SelectedText = Program.WrapTokenKey(TokenIDs.WSHScript + "[" + WSHF.listQueries.SelectedItem + "]");
                        }
                        WSHF.Close();
                    }
                    break;

                case Tokens.RegistryValue:
                    using (RegistryForm RF = new RegistryForm())
                    {
                        if (RF.ShowDialog() == System.Windows.Forms.DialogResult.OK)
                        {
                            LayoutRichTextBox.SelectedText = Program.WrapTokenKey(TokenIDs.Registry + "[" + RF.listQueries.SelectedItem + "]");
                        }
                        RF.Close();
                    }
                    break;

                default:
                    LayoutRichTextBox.SelectedText = Program.WrapTokenKey(button.Text);
                    break;
                }
            }
        }
Пример #2
0
 private void wMIQueriesToolStripMenuItem_Click(object sender, EventArgs e)
 {
     WMIQueryForm WMI = new WMIQueryForm();
     DialogResult result = WMI.ShowDialog();
 }
Пример #3
0
 private void wMIQueriesToolStripMenuItem_Click(object sender, EventArgs e)
 {
     WMIQueryForm WMI    = new WMIQueryForm();
     DialogResult result = WMI.ShowDialog();
 }
Пример #4
0
        /// <summary>
        /// Insert the clicked token in the rich text box.
        /// </summary>
        /// <param name="sender">The sender.</param>
        /// <param name="e">The <see cref="System.EventArgs"/> instance containing the event data.</param>
        private void InsertToken(object sender, EventArgs e)
        {
            ToolStripButton button = sender as ToolStripButton;

            if (button != null)
            {
                switch (button.Text)
                {
                    case Tokens.WMIData:
                        using (WMIQueryForm WQF = new WMIQueryForm())
                        {
                            if (WQF.ShowDialog() == System.Windows.Forms.DialogResult.OK)
                                LayoutRichTextBox.SelectedText = Program.WrapTokenKey(TokenIDs.WMIData + "[" + WQF.listQueries.SelectedItem + "]");
                            WQF.Close();
                        }
                        break;
                    case Tokens.WSHScript:
                        using (WSHScriptForm WSHF = new WSHScriptForm())
                        {
                            if (WSHF.ShowDialog() == System.Windows.Forms.DialogResult.OK)
                                LayoutRichTextBox.SelectedText = Program.WrapTokenKey(TokenIDs.WSHScript + "[" + WSHF.listQueries.SelectedItem + "]");
                            WSHF.Close();
                        }
                        break;
                    case Tokens.RegistryValue:
                        using (RegistryForm RF = new RegistryForm())
                        {
                            if (RF.ShowDialog() == System.Windows.Forms.DialogResult.OK)
                                LayoutRichTextBox.SelectedText = Program.WrapTokenKey(TokenIDs.Registry + "[" + RF.listQueries.SelectedItem + "]");
                            RF.Close();
                        }
                        break;
                    default:
                        LayoutRichTextBox.SelectedText = Program.WrapTokenKey(button.Text);
                        break;
                }
            }
        }