Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- if(connectMode == ext_ConnectMode.ext_cm_UISetup)
- {
- if (mIsCmdLoaded == false)
- {
- object[] contextGUIDS = new object[] { };
- Commands2 commands = (Commands2)_applicationObject.Commands;
- try
- {
- CommandBar toolsControl = (CommandBar)((CommandBars)_applicationObject.CommandBars)["Code Window"];
- var pasteMenu = (CommandBarPopup)toolsControl.Controls.Add(MsoControlType.msoControlPopup, System.Type.Missing, System.Type.Missing, 1, true);
- pasteMenu.CommandBar.Name = "VxPasteBin";
- pasteMenu.Caption = "VxPasteBin";
- Command cmd = null;
- Command cmd2 = null;
- try
- {
- cmd = commands.Item(_addInInstance.ProgID + ".VxPasteBinUpload");
- cmd2 = commands.Item(_addInInstance.ProgID + ".VxPasteBinSettings");
- }
- catch (Exception)
- {
- }
- if (cmd == null)
- cmd = commands.AddNamedCommand2(_addInInstance, "VxPasteBinUpload", "Upload", "Upload the code to pastebin!", true, 59, ref contextGUIDS, (int)(vsCommandStatus.vsCommandStatusEnabled | vsCommandStatus.vsCommandStatusSupported), (int)vsCommandStyle.vsCommandStyleText, vsCommandControlType.vsCommandControlTypeButton);
- if (cmd2 == null)
- cmd2 = commands.AddNamedCommand2(_addInInstance, "VxPasteBinSettings", "Settings", "Set the settings for pastebin.", true, 59, ref contextGUIDS, (int)(vsCommandStatus.vsCommandStatusEnabled | vsCommandStatus.vsCommandStatusSupported), (int)vsCommandStyle.vsCommandStyleText, vsCommandControlType.vsCommandControlTypeButton);
- cmd.AddControl(pasteMenu.CommandBar);
- cmd2.AddControl(pasteMenu.CommandBar, 2);
- pasteMenu.Enabled = true;
- }
- catch (System.Exception e)
- {
- System.Windows.Forms.MessageBox.Show(e.Message);
- }
- mIsCmdLoaded = true;
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment