//---------------------------------------------------------------- // Copyright (c) Microsoft Corporation. All rights reserved. //---------------------------------------------------------------- namespace Microsoft.Build.Tasks.Xaml { using System; using System.Collections.Generic; using System.Collections.ObjectModel; using Microsoft.Build.Utilities; public class BuildExtensionContext { static readonly IList emptyList = new List(0); List references; List sourceCodeFiles; List generatedFiles; List generatedResourceFiles; internal BuildExtensionContext() { } public string AssemblyName { get; internal set; } public bool IsInProcessXamlMarkupCompile { get; internal set; } public string Language { get; internal set; } public string OutputPath { get; internal set; } public ReadOnlyCollection References { get { if (this.references == null) { this.references = new List(); } return this.references.AsReadOnly(); } } public string RootNamespace { get; internal set; } public ReadOnlyCollection SourceCodeFiles { get { if (this.sourceCodeFiles == null) { this.sourceCodeFiles = new List(); } return this.sourceCodeFiles.AsReadOnly(); } } public string LocalAssembly { get; internal set; } public TaskLoggingHelper XamlBuildLogger { get; internal set; } public ReadOnlyCollection GeneratedFiles { get { if (this.generatedFiles == null) { this.generatedFiles = new List(); } return this.generatedFiles.AsReadOnly(); } } public ReadOnlyCollection GeneratedResourceFiles { get { if (this.generatedResourceFiles == null) { this.generatedResourceFiles = new List(); } return this.generatedResourceFiles.AsReadOnly(); } } public void AddGeneratedFile(string fileName) { if (this.generatedFiles == null) { this.generatedFiles = new List(); } this.generatedFiles.Add(fileName); } public void AddGeneratedResourceFile(string fileName) { if (this.generatedResourceFiles == null) { this.generatedResourceFiles = new List(); } this.generatedResourceFiles.Add(fileName); } internal void AddReferences(IList references) { if (references != null) { if (this.references == null) { this.references = new List(); } this.references.AddRange(references); } } internal void AddSourceCodeFiles(IList sourceCodeFiles) { if (sourceCodeFiles != null) { if (this.sourceCodeFiles == null) { this.sourceCodeFiles = new List(); } this.sourceCodeFiles.AddRange(sourceCodeFiles); } } } }