コード例 #1
0
        public static async Task InitializeGregt(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);
        }
        protected override async Task InitializeAsync(CancellationToken cancellationToken, IProgress <ServiceProgressData> progress)
        {
            await base.InitializeAsync(cancellationToken, progress);

            await VsixToolWindowCommand.InitializeGregt(this);//IT IS CRITICAL TO HAVE THIS HERE AS 'InitializeToolWindowAsync' NEVER GETS INVOKED
        }