internal WorkingGraph(string userDefinedName, GraphCreationType type, [NotNull][ItemNotNull] IEnumerable <Dependency> dependencies, [NotNull] ItemAndDependencyFactoryList itemAndDependencyFactories) { UserDefinedName = userDefinedName; Type = type; _dependencies = dependencies.ToList(); ClearAllCaches(); _globalItemAndDependencyFactories = itemAndDependencyFactories; }
private void RemoveSuperfluousGraphs(int limit, GraphCreationType type) { if (limit <= 0) { throw new ArgumentException("internal error", nameof(limit)); } var matchingGraphs = _workingGraphs.Where(e => e.Type == type).ToArray(); if (matchingGraphs.Length > limit) { var toBeRemoved = matchingGraphs.Take(matchingGraphs.Length - limit); _workingGraphs.RemoveAll(e => toBeRemoved.Contains(e)); } }
private void CreateWorkingGraph(string name, GraphCreationType type, IEnumerable <Dependency> dependencies) { _workingGraphs.Add(new WorkingGraph(name, type, dependencies, _itemAndDependencyFactories)); }