Beispiel #1
0
        public static async Task InitializeAsync(AsyncPackage package)
        {
            // Switch to the main thread - the call to AddCommand in Command1's constructor requires
            // the UI thread.
            await ThreadHelper.JoinableTaskFactory.SwitchToMainThreadAsync(package.DisposalToken);

            OleMenuCommandService commandService = await package.GetServiceAsync(typeof(IMenuCommandService)) as OleMenuCommandService;

            Instance = new CodeAtlasCommand(package, commandService);
        }
        /// <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()
        {
            CodeAtlasCommand.Initialize(this);
            base.Initialize();
            var mainUI = UIManager.Instance().GetMainUI();

            mainUI.SetPackage(this);
            AddCommand(0x0103, mainUI.OnFindCallers);
            AddCommand(0x0104, mainUI.OnFindCallees);
            AddCommand(0x0105, mainUI.OnFindMembers);
            AddCommand(0x0106, mainUI.OnFindOverrides);
            AddCommand(0x0107, mainUI.OnFindBases);
            AddCommand(0x0108, mainUI.OnFindUses);
            AddCommand(0x0109, mainUI.OnGoUp);
            AddCommand(0x010a, mainUI.OnGoDown);
            AddCommand(0x010b, mainUI.OnGoLeft);
            AddCommand(0x010c, mainUI.OnGoRight);
            AddCommand(0x0130, mainUI.OnGoUpInOrder);
            AddCommand(0x0131, mainUI.OnGoDownInOrder);
            AddCommand(0x010d, mainUI.OnDelectSelectedItems);
            AddCommand(0x011b, mainUI.OnDeleteNearbyItems);
            AddCommand(0x010e, mainUI.OnDeleteSelectedItemsAndAddToStop);
            AddCommand(0x010f, mainUI.OnAddSimilarCodeItem);
            AddCommand(0x0110, mainUI.OnShowInAtlas);
            AddCommand(0x011c, mainUI.OnShowDefinitionInAtlas);

            AddCommand(0x0111, mainUI.OnShowScheme1);
            AddCommand(0x0112, mainUI.OnShowScheme2);
            AddCommand(0x0113, mainUI.OnShowScheme3);
            AddCommand(0x0114, mainUI.OnShowScheme4);
            AddCommand(0x0115, mainUI.OnShowScheme5);
            AddCommand(0x0116, mainUI.OnToggleScheme1);
            AddCommand(0x0117, mainUI.OnToggleScheme2);
            AddCommand(0x0118, mainUI.OnToggleScheme3);
            AddCommand(0x0119, mainUI.OnToggleScheme4);
            AddCommand(0x011a, mainUI.OnToggleScheme5);

            AddCommand(0x011d, mainUI.OnFastAnalyseSolutionButton);
            AddCommand(0x011e, mainUI.OnFastAnalyseProjectsButton);
            AddCommand(0x0124, mainUI.OnOpen);
            AddCommand(0x0148, mainUI.OnOpenDefault);
            AddCommand(0x0125, mainUI.OnClose);

            AddCommand(0x0128, mainUI.OnBeginCustomEdge);
            AddCommand(0x0129, mainUI.OnEndCustomEdge);

            AddCommand(0x0133, mainUI.ToggleAnchor);

            AddCommand(0x0135, mainUI.ShowProject);
            AddCommand(0x0136, mainUI.ShowAllProjects);

            AddCommand(0x0145, mainUI.PrevButton_Click);
            AddCommand(0x0146, mainUI.NextButton_Click);
            UIManager.Instance().GetScene().StartThread();
        }
Beispiel #3
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 async Task InitializeAsync(CancellationToken cancellationToken, IProgress <ServiceProgressData> progress)
        {
            // When initialized asynchronously, the current thread may be a background thread at this point.
            // Do any initialization that requires the UI thread after switching to the UI thread.
            await this.JoinableTaskFactory.SwitchToMainThreadAsync(cancellationToken);

            await CodeAtlasCommand.InitializeAsync(this);

            //base.Initialize();
            var mainUI = UIManager.Instance().GetMainUI();

            mainUI.SetPackage(this);
            AddCommand(0x0103, mainUI.OnFindCallers);
            AddCommand(0x0104, mainUI.OnFindCallees);
            AddCommand(0x0105, mainUI.OnFindMembers);
            AddCommand(0x0106, mainUI.OnFindOverrides);
            AddCommand(0x0107, mainUI.OnFindBases);
            AddCommand(0x0108, mainUI.OnFindUses);
            AddCommand(0x0109, mainUI.OnGoUp);
            AddCommand(0x010a, mainUI.OnGoDown);
            AddCommand(0x010b, mainUI.OnGoLeft);
            AddCommand(0x010c, mainUI.OnGoRight);
            AddCommand(0x0130, mainUI.OnGoUpInOrder);
            AddCommand(0x0131, mainUI.OnGoDownInOrder);
            AddCommand(0x010d, mainUI.OnDelectSelectedItems);
            AddCommand(0x011b, mainUI.OnDeleteNearbyItems);
            AddCommand(0x010e, mainUI.OnDeleteSelectedItemsAndAddToStop);
            AddCommand(0x010f, mainUI.OnAddSimilarCodeItem);
            AddCommand(0x0110, mainUI.OnShowInAtlas);
            AddCommand(0x011c, mainUI.OnShowDefinitionInAtlas);

            AddCommand(0x0111, mainUI.OnShowScheme1);
            AddCommand(0x0112, mainUI.OnShowScheme2);
            AddCommand(0x0113, mainUI.OnShowScheme3);
            AddCommand(0x0114, mainUI.OnShowScheme4);
            AddCommand(0x0115, mainUI.OnShowScheme5);
            AddCommand(0x0116, mainUI.OnToggleScheme1);
            AddCommand(0x0117, mainUI.OnToggleScheme2);
            AddCommand(0x0118, mainUI.OnToggleScheme3);
            AddCommand(0x0119, mainUI.OnToggleScheme4);
            AddCommand(0x011a, mainUI.OnToggleScheme5);

            AddCommand(0x011d, mainUI.OnFastAnalyseSolutionButton);
            AddCommand(0x011e, mainUI.OnFastAnalyseProjectsButton);
            AddCommand(0x0149, mainUI.OnAnalyseFilesSolutionButton);
            AddCommand(0x0124, mainUI.OnOpen);
            AddCommand(0x0148, mainUI.OnOpenDefault);
            AddCommand(0x0125, mainUI.OnClose);

            AddCommand(0x0128, mainUI.OnBeginCustomEdge);
            AddCommand(0x0129, mainUI.OnEndCustomEdge);

            AddCommand(0x0133, mainUI.ToggleAnchor);

            AddCommand(0x0135, mainUI.ShowProject);
            AddCommand(0x0136, mainUI.ShowAllProjects);

            AddCommand(0x0145, mainUI.PrevButton_Click);
            AddCommand(0x0146, mainUI.NextButton_Click);
            UIManager.Instance().GetScene().StartThread();
        }
Beispiel #4
0
 /// <summary>
 /// Initializes the singleton instance of the command.
 /// </summary>
 /// <param name="package">Owner package, not null.</param>
 public static void Initialize(Package package)
 {
     Instance = new CodeAtlasCommand(package);
 }