/// <summary>
 /// Registers services implemented by this package.
 /// </summary>
 protected override void Initialize()
 {
     base.Initialize();
     TransformationContextProvider.Register(this);
     TemplateLocator.Register(this);
     this.extenderProviders.Add(new BrowseObjectExtenderProvider(this, PrjBrowseObjectCATID.prjCATIDCSharpFileBrowseObject));
     this.extenderProviders.Add(new BrowseObjectExtenderProvider(this, PrjBrowseObjectCATID.prjCATIDVBFileBrowseObject));
 }
        /// <summary>
        /// Registers services implemented by this package.
        /// </summary>
        protected override async System.Threading.Tasks.Task InitializeAsync(CancellationToken cancellationToken, IProgress <ServiceProgressData> progress)
        {
            Instance = this;
            await base.InitializeAsync(cancellationToken, progress);

            TransformationContextProvider.Register(this);
            TemplateLocator.Register(this);

            var objectExtenders = (ObjectExtenders)await this.GetServiceAsync(typeof(ObjectExtenders));

            this.extenderProviders.Add(new BrowseObjectExtenderProvider(this, objectExtenders, PrjBrowseObjectCATID.prjCATIDCSharpFileBrowseObject));
            this.extenderProviders.Add(new BrowseObjectExtenderProvider(this, objectExtenders, PrjBrowseObjectCATID.prjCATIDVBFileBrowseObject));
        }
Exemple #3
0
        internal BrowseObjectExtender(IAsyncServiceProvider2 serviceProvider, IVsBrowseObject browseObject, IExtenderSite site, int cookie)
        {
            Debug.Assert(serviceProvider != null, "serviceProvider");
            Debug.Assert(browseObject != null, "browseObject");
            Debug.Assert(site != null, "site");
            Debug.Assert(cookie != 0, "cookie");

            this.site            = site;
            this.cookie          = cookie;
            this.serviceProvider = serviceProvider;
            ErrorHandler.ThrowOnFailure(browseObject.GetProjectItem(out this.hierarchy, out this.itemId));
            this.propertyStorage      = (IVsBuildPropertyStorage)this.hierarchy;
            this.CustomToolParameters = new CustomToolParameters(this.serviceProvider, this.hierarchy, this.itemId);
            this.templateLocator      = (TemplateLocator)this.serviceProvider.GetServiceAsync(typeof(TemplateLocator)).Result;
        }