Exemplo n.º 1
0
        /// <summary>
        /// Creates a new <see cref="ScriptOptions"/> with the search paths changed.
        /// </summary>
        /// <exception cref="ArgumentNullException"><paramref name="searchPaths"/> is null or contains a null reference.</exception>
        public ScriptOptions WithSearchPaths(IEnumerable <string> searchPaths)
        {
            if (searchPaths != null && SearchPaths.SequenceEqual(searchPaths))
            {
                return(this);
            }

            // TODO:
            var resolver = new AssemblyReferenceResolver(
                _referenceResolver.PathResolver.WithSearchPaths(ToImmutableArrayChecked(searchPaths, nameof(searchPaths))),
                _referenceResolver.Provider);

            return(With(resolver: resolver));
        }
Exemplo n.º 2
0
 public bool Equals(RelativePathResolver other) =>
 BaseDirectory == other.BaseDirectory && SearchPaths.SequenceEqual(other.SearchPaths);