예제 #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 async System.Threading.Tasks.Task InitializeAsync(CancellationToken cancellationToken, IProgress <ServiceProgressData> progress)
        {
            await base.InitializeAsync(cancellationToken, progress);

            // Switches to the UI thread in order to consume some services used in command initialization
            await JoinableTaskFactory.SwitchToMainThreadAsync(cancellationToken);

            _optionPage = (CBEOptionPage)Instance.GetDialogPage(typeof(CBEOptionPage));
            _optionPage.OptionChanged += Page_OptionChanged;

            // Update taggers, that were initialized before the package
            PackageOptionChanged?.Invoke(this);
        }
예제 #2
0
 private void Page_OptionChanged(object sender) => PackageOptionChanged?.Invoke(this);