private void btnRegisterDebugEngine_Click(object sender, EventArgs e) { if (MessageBox.Show("NPL debug engine only needs to be registered once in registry after initial installation or upgrade. In order to register NPL debug engine, you need to run visual studio as administrator. Are you running as administrator?", "Register NPL/lua debug engine", MessageBoxButtons.YesNo) == DialogResult.Yes) { NPLDebuggerConnect.RegisterNPLDebugEngineDll(); } }
/// <summary> /// Initialization of the package; this method is called right after the package is sited, so this is the place /// where you can put all the initialization code that rely on services provided by VisualStudio. /// </summary> protected override void Initialize() { DTE dte = (DTE)GetService(typeof(DTE)); DTE2 = dte as DTE2; GuidList.gPackage = this; Trace.WriteLine(string.Format(CultureInfo.CurrentCulture, "Entering Initialize() of: {0}", this.ToString())); base.Initialize(); // retrieve the installation directory PackageRootPath = ObtainInstallationFolder() + "\\"; // create the NPL Debugger NPLDebugger = new NPLDebuggerConnect(DTE2, this); // Add our command handlers for menu (commands must exist in the .vsct file) OleMenuCommandService mcs = GetService(typeof(IMenuCommandService)) as OleMenuCommandService; if (null != mcs) { // Create the command for the menu item. CommandID menuCommandID = new CommandID(GuidList.guidNPLDebuggerPackageCmdSet, (int)PkgCmdIDList.cmdidNPLDebuggerCommand); MenuCommand menuItem = new MenuCommand(MenuItemCallback, menuCommandID); mcs.AddCommand(menuItem); // Create the command for the tool window CommandID toolwndCommandID = new CommandID(GuidList.guidNPLDebuggerPackageCmdSet, (int)PkgCmdIDList.cmdidNPLDebuggerTool); MenuCommand menuToolWin = new MenuCommand(ShowToolWindow, toolwndCommandID); mcs.AddCommand(menuToolWin); } }
/// <summary> /// Initialization of the package; this method is called right after the package is sited, so this is the place /// where you can put all the initilaization code that rely on services provided by VisualStudio. /// </summary> protected override void Initialize() { DTE dte = (DTE)GetService(typeof(DTE)); DTE2 = dte as DTE2; GuidList.gPackage = this; Trace.WriteLine (string.Format(CultureInfo.CurrentCulture, "Entering Initialize() of: {0}", this.ToString())); base.Initialize(); // retrieve the installation directory using (RegistryKey rootKey = this.UserRegistryRoot) { using (RegistryKey packageKey = rootKey.OpenSubKey("ExtensionManager\\EnabledExtensions")) { PackageRootPath = packageKey.GetValue(GuidList.guidNPLDebuggerPackagePkgString + ",1.0") as String; } } // create the NPL Debugger NPLDebugger = new NPLDebuggerConnect(DTE2, this); // Add our command handlers for menu (commands must exist in the .vsct file) OleMenuCommandService mcs = GetService(typeof(IMenuCommandService)) as OleMenuCommandService; if ( null != mcs ) { // Create the command for the menu item. CommandID menuCommandID = new CommandID(GuidList.guidNPLDebuggerPackageCmdSet, (int)PkgCmdIDList.cmdidNPLDebuggerCommand); MenuCommand menuItem = new MenuCommand(MenuItemCallback, menuCommandID ); mcs.AddCommand( menuItem ); // Create the command for the tool window CommandID toolwndCommandID = new CommandID(GuidList.guidNPLDebuggerPackageCmdSet, (int)PkgCmdIDList.cmdidNPLDebuggerTool); MenuCommand menuToolWin = new MenuCommand(ShowToolWindow, toolwndCommandID); mcs.AddCommand( menuToolWin ); } }
/// <summary> /// Initialization of the package; this method is called right after the package is sited, so this is the place /// where you can put all the initialization code that rely on services provided by VisualStudio. /// </summary> protected override void Initialize() { DTE dte = (DTE)GetService(typeof(DTE)); DTE2 = dte as DTE2; GuidList.gPackage = this; Trace.WriteLine (string.Format(CultureInfo.CurrentCulture, "Entering Initialize() of: {0}", this.ToString())); base.Initialize(); // retrieve the installation directory PackageRootPath = ObtainInstallationFolder() + "\\"; // create the NPL Debugger NPLDebugger = new NPLDebuggerConnect(DTE2, this); // Add our command handlers for menu (commands must exist in the .vsct file) OleMenuCommandService mcs = GetService(typeof(IMenuCommandService)) as OleMenuCommandService; if ( null != mcs ) { // Create the command for the menu item. CommandID menuCommandID = new CommandID(GuidList.guidNPLDebuggerPackageCmdSet, (int)PkgCmdIDList.cmdidNPLDebuggerCommand); MenuCommand menuItem = new MenuCommand(MenuItemCallback, menuCommandID ); mcs.AddCommand( menuItem ); // Create the command for the tool window CommandID toolwndCommandID = new CommandID(GuidList.guidNPLDebuggerPackageCmdSet, (int)PkgCmdIDList.cmdidNPLDebuggerTool); MenuCommand menuToolWin = new MenuCommand(ShowToolWindow, toolwndCommandID); mcs.AddCommand( menuToolWin ); } }