예제 #1
0
 public ModuleComponent(ProjectModule module, Func <String> nameGetter)
 {
     this.nameGetter  = nameGetter;
     this.module      = module;
     this.Connections = module.Presentation.Connections;
     module.AddComponent(this);
 }
예제 #2
0
        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);
 }