コード例 #1
0
        protected override async Task InitializeAsync(CancellationToken cancellationToken, IProgress <ServiceProgressData> progress)
        {
            await base.InitializeAsync(cancellationToken, progress);

            await VsixToolWindowCommand.InitializeCommandAsync(this);//IT IS CRITICAL TO HAVE THIS HERE

            InitializeDelegates();
        }
コード例 #2
0
        public static async Task InitializeCommandAsync(AsyncPackage asyncPackage)
        {
            if (asyncPackage == null)
            {
                throw new ArgumentNullException(nameof(asyncPackage));
            }
            _asyncPackage = asyncPackage;

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

            Instance = new VsixToolWindowCommand(commandService);
        }