/// <summary> /// Instantiate the project class, but do not proceed with the /// initialization just yet. /// Delegate to CreateProject implemented by the derived class. /// </summary> protected override object PreCreateForOuter(IntPtr outerProjectIUnknown) { Debug.Assert(this.buildProject != null, "The build project should have been initialized before calling PreCreateForOuter."); GlobalPropertyHandler globalPropertyHandler = new GlobalPropertyHandler(this.buildProject); globalPropertyHandler.InitializeGlobalProperties(); // Please be very carefull what is initialized here on the ProjectNode. Normally this should only instantiate and return a project node. // The reason why one should very carefully add state to the project node here is that at this point the aggregation has not yet been created and anything that would cause a CCW for the project to be created would cause the aggregation to fail // Our reasoning is that there is no other place where state on the project node can be set that is known by the Factory and has to execute before the Load method. ProjectNode node = this.CreateProject(); Debug.Assert(node != null, "The project failed to be created"); node.BuildEngine = this.buildEngine; node.BuildProject = this.buildProject; node.GlobalPropetyHandler = globalPropertyHandler; globalPropertyHandler.RegisterConfigurationChangeListener(node, this.site); node.Package = this.package as ProjectPackage; return node; }
/// <summary> /// Overloaded constructor. /// </summary> /// <param name="globalProperties"></param> /// <param name="associatedHierachy">The associated hierrachy.</param> /// <param name="serviceProvider">The associated service provider</param> internal UpdateConfigPropertiesListener(GlobalPropertyHandler globalPropertyHandler, IServiceProvider serviceProvider) : base(serviceProvider) { this.globalPropertyHandler = globalPropertyHandler; }