Exemple #1
0
        /// <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()
        {
            base.Initialize();

            // Add our command handlers for menu (commands must exist in the .vsct file)
            OleMenuCommandService mcs = base.GetService(typeof(IMenuCommandService)) as OleMenuCommandService;

            if (mcs != null)
            {
                CommandID   commandId = new CommandID(GuidList.guidVSExtensionCmdSet, PkgCmdIDList.ContractorExplorerButton);
                MenuCommand menuCmd   = new MenuCommand(ShowToolWindow, commandId);
                mcs.AddCommand(menuCmd);

                commandId = new CommandID(GuidList.guidVSExtensionCmdSet, PkgCmdIDList.OptionPageButton);
                menuCmd   = new MenuCommand(ShowOptionPage, commandId);
                mcs.AddCommand(menuCmd);
            }

            try
            {
                Configuration.Initialize();
            }
            catch (Exception ex)
            {
                ContractorExplorerControl.HandleException(ex);
            }
        }
Exemple #2
0
 /// <summary>
 /// Standard constructor for the tool window.
 /// </summary>
 public ContractorExplorer() :
     base(null)
 {
     // Set the window title reading it from the resources.
     this.Caption = Resources.ToolWindowTitle;
     // Set the image that will appear on the tab of the window frame
     // when docked with an other window
     // The resource ID correspond to the one defined in the resx file
     // while the Index is the offset in the bitmap strip. Each image in
     // the strip being 16x16.
     this.BitmapResourceID = 301;
     this.BitmapIndex      = 1;
     this.ToolBar          = new CommandID(GuidList.guidVSExtensionCmdSet, PkgCmdIDList.ContractExplorerToolbar);
     this.control          = new ContractorExplorerControl();
 }