/// <summary> /// This is overridden to initialize the package /// </summary> /// <remarks>This method is called right after the package is sited, so /// this is the place where you can put all the initialization code /// that relies on services provided by Visual Studio.</remarks> protected override void Initialize() { Trace.WriteLine(string.Format(CultureInfo.CurrentCulture, "Entering Initialize() of: {0}", this.ToString())); base.Initialize(); SandcastleBuilderPackage.Instance = this; // Register the project factory this.RegisterProjectFactory(new SandcastleBuilderProjectFactory(this)); // Register the SHFB file editor factories base.RegisterEditorFactory(new ContentLayoutEditorFactory()); base.RegisterEditorFactory(new ResourceItemEditorFactory()); base.RegisterEditorFactory(new SiteMapEditorFactory()); base.RegisterEditorFactory(new TokenEditorFactory()); // Create the update solution event listener for build completed events buildCompletedListener = new BuildCompletedEventListener(this); ObjectExtenders objectExtenders = (ObjectExtenders)GetService(typeof(ObjectExtenders)); _singleFileGeneratorNodeExtenderProvider = new SingleFileGeneratorNodeExtenderProvider(); string extenderCatId = typeof(SandcastleBuilderFileNodeProperties).GUID.ToString("B"); string extenderName = SingleFileGeneratorNodeExtenderProvider.Name; string localizedName = extenderName; _singleFileGeneratorNodeExtenderCookie = objectExtenders.RegisterExtenderProvider(extenderCatId, extenderName, _singleFileGeneratorNodeExtenderProvider, localizedName); }
private async Task RegisterExtenderProviderAsync(string catId) { await JoinableTaskFactory.SwitchToMainThreadAsync(DisposalToken); const string name = AutoT4ExtenderProvider.Name; _objectExtenders = _objectExtenders ?? await GetServiceAsync(typeof(ObjectExtenders)) as ObjectExtenders; Assumes.Present(_objectExtenders); _extenderProvider = _extenderProvider ?? new AutoT4ExtenderProvider(_dte); _extenderProviderCookies.Add(_objectExtenders.RegisterExtenderProvider(catId, name, _extenderProvider)); }
private void RegisterExtenderProvider(string catId) { const string name = AutoT4ExtenderProvider.Name; _objectExtenders = _objectExtenders ?? GetService(typeof(ObjectExtenders)) as ObjectExtenders; if (_objectExtenders == null) { return; } _extenderProvider = _extenderProvider ?? new AutoT4ExtenderProvider(_dte, this); _extenderProviderCookies.Add(_objectExtenders.RegisterExtenderProvider(catId, name, _extenderProvider)); }
private void RegisterExtenderProvider(string catId) { const string name = AutoT4ExtenderProvider.Name; _objectExtenders = _objectExtenders ?? GetService(typeof(ObjectExtenders)) as ObjectExtenders; if (_objectExtenders == null) return; _extenderProvider = _extenderProvider ?? new AutoT4ExtenderProvider(_dte); _extenderProviderCookies.Add(_objectExtenders.RegisterExtenderProvider(catId, name, _extenderProvider)); }