Ejemplo n.º 1
0
        /// <summary>
        /// Creates a menu item for the plugin and adds a ignored key
        /// </summary>
        public void CreateMenuItem()
        {
            ToolStripMenuItem menu = (ToolStripMenuItem)PluginBase.MainForm.FindMenuItem("InsertMenu");

            if (menu != null)
            {
                menu.DropDownItems.Add(new ToolStripSeparator());

                TraceMenu traceMenu = new TraceMenu();

                traceMenu.TraceSimple.Click          += new EventHandler(TraceSimple);
                traceMenu.TraceForIn.Click           += new EventHandler(TraceForIn);
                traceMenu.TraceAlternateSimple.Click += new EventHandler(TraceAlternateSimple);
                traceMenu.TraceAlternateForIn.Click  += new EventHandler(TraceAlternateForIn);

                Keys kTS   = this.settingObject.TraceSimple;
                Keys kTFI  = this.settingObject.TraceForIn;
                Keys kTAS  = this.settingObject.TraceAlternateSimple;
                Keys kTAFI = this.settingObject.TraceAlternateForIn;

                traceMenu.TraceSimple.ShortcutKeys          = kTS;
                traceMenu.TraceForIn.ShortcutKeys           = kTFI;
                traceMenu.TraceAlternateSimple.ShortcutKeys = kTAS;
                traceMenu.TraceAlternateForIn.ShortcutKeys  = kTAFI;

                PluginBase.MainForm.IgnoredKeys.Add(kTS);
                PluginBase.MainForm.IgnoredKeys.Add(kTFI);
                PluginBase.MainForm.IgnoredKeys.Add(kTAS);
                PluginBase.MainForm.IgnoredKeys.Add(kTAFI);

                menu.DropDownItems.Add(traceMenu);
            }
        }
Ejemplo n.º 2
0
        /// <summary>
        /// Creates a menu item for the plugin and adds a ignored key
        /// </summary>
        public void CreateMenuItem()
        {
            ToolStripMenuItem menu = (ToolStripMenuItem)PluginBase.MainForm.FindMenuItem("InsertMenu");
            if (menu != null)
            {
                menu.DropDownItems.Add(new ToolStripSeparator());

                TraceMenu traceMenu = new TraceMenu();

                traceMenu.TraceSimple.Click += new EventHandler(TraceSimple);
                traceMenu.TraceForIn.Click += new EventHandler(TraceForIn);
                traceMenu.TraceAlternateSimple.Click += new EventHandler(TraceAlternateSimple);
                traceMenu.TraceAlternateForIn.Click += new EventHandler(TraceAlternateForIn);

                Keys kTS = this.settingObject.TraceSimple;
                Keys kTFI = this.settingObject.TraceForIn;
                Keys kTAS = this.settingObject.TraceAlternateSimple;
                Keys kTAFI = this.settingObject.TraceAlternateForIn;

                traceMenu.TraceSimple.ShortcutKeys = kTS;
                traceMenu.TraceForIn.ShortcutKeys = kTFI;
                traceMenu.TraceAlternateSimple.ShortcutKeys = kTAS;
                traceMenu.TraceAlternateForIn.ShortcutKeys = kTAFI;

                PluginBase.MainForm.IgnoredKeys.Add(kTS);
                PluginBase.MainForm.IgnoredKeys.Add(kTFI);
                PluginBase.MainForm.IgnoredKeys.Add(kTAS);
                PluginBase.MainForm.IgnoredKeys.Add(kTAFI);

                menu.DropDownItems.Add(traceMenu);
            }
        }