public ModuleComponent(ProjectModule module, Func <String> nameGetter) { this.nameGetter = nameGetter; this.module = module; this.Connections = module.Presentation.Connections; module.AddComponent(this); }
public bool HasDescendent(IImplementation query) { if (query == this.Implementation) { return(true); } Dictionary <ProjectModule, bool> visited = new Dictionary <ProjectModule, bool>(); Queue <ProjectModule> toVisit = new Queue <ProjectModule>(); toVisit.Enqueue(this); visited[this] = true; while (toVisit.Count > 0) { ProjectModule cur = toVisit.Dequeue(); foreach (ModuleComponent comp in cur.Implementation.GetModuleComponents()) { ProjectModule sub = comp.Module; if (!visited.ContainsKey(sub)) { if (sub.Implementation == query) { return(true); } visited[sub] = true; toVisit.Enqueue(sub); } } } return(false); }
public DefaultPresentation(ProjectModule module) { UpdateConnections(module.Implementation.Connections); }