/// <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(); mRunningDocTableEvents = new RunningDocTableEvents(this); //Settings command is always visible mSettingsCmd = new SettingsCommand(this, CommandSet, CommandIds.kSettingsId); var dte = GetService(typeof(DTE)) as DTE2; mBuildEvents = dte.Events.BuildEvents; mCommandEvents = dte.Events.CommandEvents; var generalOptions = (GeneralOptions)this.GetDialogPage(typeof(GeneralOptions)); if (null == generalOptions.Version || string.IsNullOrWhiteSpace(generalOptions.Version)) { ShowToolbare(dte); // Show the toolbar on the first install } AdviseSolutionEvents(); }
/// <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 async override System.Threading.Tasks.Task InitializeAsync(CancellationToken cancellationToken, IProgress <ServiceProgressData> progress) { mRunningDocTableEvents = new RunningDocTableEvents(this); mDte = await GetServiceAsync(typeof(DTE)) as DTE2; //Settings command is always visible mSettingsCmd = new SettingsCommand(mDte, this, CommandSet, CommandIds.kSettingsId); mBuildEvents = mDte.Events.BuildEvents; mCommandEvents = mDte.Events.CommandEvents; var generalOptions = (ClangGeneralOptionsView)this.GetDialogPage(typeof(ClangGeneralOptionsView)); if (null == generalOptions.Version || string.IsNullOrWhiteSpace(generalOptions.Version)) { ShowToolbare(mDte); // Show the toolbar on the first install } AdviseSolutionEvents(); await base.InitializeAsync(cancellationToken, progress); }