示例#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 initialization code that rely on services provided by VisualStudio.
        /// </summary>
        protected override void Initialize()
        {
            base.Initialize();

            var applicationObject = (DTE2)GetService(typeof(DTE));

            vsIntegration.OnConnect(applicationObject);
            fortranCodeNav = new FortranCodeNavCore.FortranCodeNavCore(vsIntegration);

            AboutCommand.Initialize(this, fortranCodeNav.AboutDialog);
            BrowseToCommand.Initialize(this, fortranCodeNav.BrowseTo);
            FindUsageCommand.Initialize(this, fortranCodeNav.FindUsage);
            FindMembersCommand.Initialize(this, fortranCodeNav.FindMembers);
            FileMembersCommand.Initialize(this, fortranCodeNav.ShowFileMembers);
            SyncSolutionExplorerCommand.Initialize(this, fortranCodeNav.SyncSolutionExplorer);
            FindFilesCommand.Initialize(this, fortranCodeNav.FindFiles);

            SetDefaultBinding(AboutCommand.CommandSet, AboutCommand.CommandId, "Global::Alt+F1");
            SetDefaultBinding(BrowseToCommand.CommandSet, BrowseToCommand.CommandId, "Global::Ctrl+Q");
            SetDefaultBinding(FindUsageCommand.CommandSet, FindUsageCommand.CommandId, "Global::Alt+Q");
            SetDefaultBinding(FindMembersCommand.CommandSet, FindMembersCommand.CommandId, "Global::Ctrl+Alt+Q");
            SetDefaultBinding(FileMembersCommand.CommandSet, FileMembersCommand.CommandId, "Global::Ctrl+Shift+Q");
            SetDefaultBinding(SyncSolutionExplorerCommand.CommandSet, SyncSolutionExplorerCommand.CommandId, "Global::Shift+Alt+Q");
            SetDefaultBinding(FindFilesCommand.CommandSet, FindFilesCommand.CommandId, "Global::Ctrl+Shift+Alt+Q");
        }
 /// <summary>
 /// Initializes the singleton instance of the command.
 /// </summary>
 /// <param name="package">Owner package, not null.</param>
 public static void Initialize(Package package, Action action)
 {
     Instance        = new FindMembersCommand(package);
     Instance.action = action;
 }