private void VisitChildren(ModelComponent component) { foreach (ModelComponent child in component.GetChildren()) { child.Accept(this); } }
public void Visit(ModelComponent component) { component.UnregisterAll(); foreach (ModelComponent c in component.GetChildren()) { c.Accept(this); } }
public void Visit(ModelComponent component) { component.UnregisterAll(); foreach (ModelComponent c in component.GetChildren()) { c.Accept(this); } }
public void SetContainer(ModelComponent composite) { if (container != null) { container.GetChildren().Remove(this); } container = composite; }
/// <summary> /// Checks the accepting component to see if it is the type we are looking for, and if so, checks for the child given at construction. /// Updates the state of the visitor and ensures that it will not be evaluated again. /// </summary> /// <param name="component"></param> public override void Visit(ModelComponent component) { if (modelType.GetType().Equals(component.GetType()) && !evaluated) { foreach (ModelComponent mc in component.GetChildren()) { if (mc == child) { containsChild = true; break; } } evaluated = true; } }
public void SetContainer(ModelComponent composite) { ModelComponent tempContainer = container; if (container != null) { container.GetChildren().Remove(this); } container = composite; // Notify the new tree. NotifyAll(); if (tempContainer != null) { // Notify the old tree. tempContainer.NotifyAll(); } }
private void VisitChildren(ModelComponent component) { foreach (ModelComponent child in component.GetChildren()) { child.Accept(this); } }