public ReferenceInfo(Dictionary <ComponentWrapper, ReferenceData> references, ProjectWrapper Project, SolutionWrapper Solution, OnAddComponentHandler OnAddComponent) { this.ReadOnlyComponents = new List <ComponentWrapper>(); this.Project = Project; this.Solution = Solution; this.OnAddComponent = OnAddComponent; this.AddedComponents = new Collection <ComponentWrapper>(); this.RemovedComponents = new Collection <ComponentWrapper>(); if (references != null) { this.References = references; } else { this.References = new Dictionary <ComponentWrapper, ReferenceData>(); foreach (BaseWrapper wrapper in GetComponents()) { ComponentWrapper component = ComponentWrapper.GetComponentWrapper(wrapper); References.Add(component, new ReferenceData(wrapper)); } foreach (ComponentWrapper component in this.References.Keys) { BaseWrapper wrapper = this[component].Wrapper; switch (component.ComponentType) { case ComponentTypeWrapper.Library: LibraryWrapper library = wrapper as LibraryWrapper; Debug.Assert(library != null); library.Dependencies = GetComponents(library.Dependencies); if ((library.LibraryCategory != null) && (library.HasLibraryCategory)) { library.LibraryCategory = GetComponent(library.LibraryCategory); } break; case ComponentTypeWrapper.Feature: FeatureWrapper feature = wrapper as FeatureWrapper; Debug.Assert(feature != null); feature.FeatureDependencies = GetComponents(feature.FeatureDependencies); feature.ComponentDependencies = GetComponents(feature.ComponentDependencies); break; case ComponentTypeWrapper.LibraryCategory: LibraryCategoryWrapper libcat = wrapper as LibraryCategoryWrapper; Debug.Assert(libcat != null); libcat.FeatureAssociations = GetComponents(libcat.FeatureAssociations); break; default: Debug.Assert(false); break; } } this.Solution.TransportType.FeatureAssociations = GetComponents(this.Solution.TransportType.FeatureAssociations); } }
public ReferenceInfo(ProjectWrapper Project, SolutionWrapper Solution, OnAddComponentHandler OnAddComponent) : this(null, Project, Solution, OnAddComponent) { }