/// <summary> /// Adds enumeration of bin directories to reference collection. /// </summary> /// <param name="collection">Target collection of references.</param> /// <param name="binDirectories">Enumeration of directories to add.</param> /// <returns><paramref name="collection"/> (for fluency).</returns> public static CompilerReferenceCollection AddDirectories(this CompilerReferenceCollection collection, IEnumerable <string> binDirectories) { Ensure.NotNull(collection, "collection"); Ensure.NotNull(binDirectories, "binDirectories"); foreach (string binDirectory in binDirectories) { collection.AddDirectory(binDirectory); } return(collection); }
/// <summary> /// Returns collection of references. /// </summary> /// <param name="configuration">Compiler configuration.</param> /// <returns>Collection of references.</returns> public static CompilerReferenceCollection References(this ICompilerConfiguration configuration) { Ensure.NotNull(configuration, "configuration"); CompilerReferenceCollection references; if (!configuration.TryGet("References", out references)) { configuration.Add("References", references = new CompilerReferenceCollection()); } return(references); }
/// <summary> /// Sets collection of references. /// </summary> /// <param name="configuration">Compiler configuration.</param> /// <param name="references">Collection of references.</param> /// <returns>Self (for fluency).</returns> public static ICompilerConfiguration AddReferences(this ICompilerConfiguration configuration, CompilerReferenceCollection references) { Ensure.NotNull(configuration, "configuration"); Ensure.NotNull(references, "references"); configuration.Add("References", references); return(configuration); }