protected ProjectEntry(string rel, bool isOpen, DirectoryInfo dir, ImmutableList <DirectoryEntry> directories, ImmutableList <Entry> files, ReferencesEntry references, int id) : base(rel, isOpen, dir, directories, files) { _id = id; _references = references; _children = new Lazy <IReadOnlyList <Entry> >(() => ImmutableList.Create <Entry>(_references).AddRange(base.Children)); }
private ProjectEntry WithReferences(ReferencesEntry newRef, JObject changes, JObject subChanges) { var indexChange = new JObject(); Utils.RegisterChange(indexChange, "0", newRef, subChanges); // Note: I use null here because I don't want to create the lists. // given that indexChange will never be null, this is safe. Utils.RegisterChange(changes, () => Children, null, indexChange); return(new ProjectEntry(RelativePath, IsOpen, _dir, _directories, _files, newRef, _id)); }
protected ProjectEntry(string rel, bool isOpen, DirectoryInfo dir, ImmutableList <DirectoryEntry> directories, ImmutableList <Entry> files, ReferencesEntry references, ImmutableList <DiagnosticMessage> diagnostics, int id, ImmutableList <string> sources, ImmutableDictionary <string, string> generatedSources, IImmutableList <ConfigurationData> configurations) : base(rel, isOpen, dir, directories, files) { _id = id; _references = references; _children = new Lazy <IReadOnlyList <Entry> >(() => ImmutableList.Create <Entry>(_references).AddRange(base.Children)); _diagnostics = diagnostics; _sources = sources; _generatedSources = generatedSources; _configurations = configurations; }
protected ProjectEntry(string rel, bool isOpen, DirectoryInfo dir, ImmutableList<DirectoryEntry> directories, ImmutableList<Entry> files, ReferencesEntry references, ImmutableList<DiagnosticMessage> diagnostics, int id, ImmutableList<string> sources, ImmutableDictionary<string, string> generatedSources, IImmutableList<ConfigurationData> configurations) : base(rel, isOpen, dir, directories, files) { _id = id; _references = references; _children = new Lazy<IReadOnlyList<Entry>>(() => ImmutableList.Create<Entry>(_references).AddRange(base.Children)); _diagnostics = diagnostics; _sources = sources; _generatedSources = generatedSources; _configurations = configurations; }
public ProjectEntry WithReferences(ReferencesEventArgs e, JObject c) { Func <string, string, ReferenceEntry> lookup = null; lookup = (name, rel) => { var nrel = rel + ":" + name; var package = e.Packages[name]; var deps = package.Dependencies.Select(d => lookup(d.Name, nrel)).ToImmutableList(); return(new ReferenceEntry(nrel, false, package.Name, package.Version, package.Unresolved, deps)); }; var newRef = new ReferencesEntry(_references.IsOpen, _references.RelativePath, lookup(e.Root, _references.RelativePath).Dependencies); return(WithReferences(newRef, c, null)); }
private ProjectEntry WithReferences(ReferencesEntry newRef, JObject changes, JObject subChanges) { var indexChange = new JObject(); Utils.RegisterChange(indexChange, "0", newRef, subChanges); // Note: I use null here because I don't want to create the lists. // given that indexChange will never be null, this is safe. Utils.RegisterChange(changes, () => Children, null, indexChange); return new ProjectEntry(RelativePath, IsOpen, _dir, _directories, _files, newRef, _diagnostics, _id, _sources, _generatedSources, _configurations); }
public ProjectEntry WithReferences(ReferencesEventArgs e, JObject c) { Func<string, string, ReferenceEntry> lookup = null; lookup = (name, rel) => { var nrel = rel + ":" + name; var package = e.Packages[name]; var deps = package.Dependencies.Select(d => lookup(d.Name, nrel)).ToImmutableList(); return new ReferenceEntry(nrel, false, package.Name, package.Version, package.Unresolved, deps); }; var newRef = new ReferencesEntry(_references.IsOpen, _references.RelativePath, lookup(e.Root, _references.RelativePath).Dependencies, e); return WithReferences(newRef, c, null); }