Ejemplo n.º 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;
                }
            }
        }
Ejemplo n.º 2
0
 private void registryKeysToolStripMenuItem_Click(object sender, EventArgs e)
 {
     RegistryForm R = new RegistryForm();
     DialogResult result = R.ShowDialog();
 }
Ejemplo n.º 3
0
 private void registryKeysToolStripMenuItem_Click(object sender, EventArgs e)
 {
     RegistryForm R      = new RegistryForm();
     DialogResult result = R.ShowDialog();
 }
Ejemplo n.º 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;
                }
            }
        }