Exemple #1
0
 public override void Visit(GraphicsObject go)
 {
     Console.WriteLine("Not sure about this one " + go.Name);
 }
Exemple #2
0
 public void Traverse(GraphicsObject go)
 {
     var group = go as Group;
     if (group != null)
     {
         Visit(group);
         TraverseChildren(group.Children);
         return;
     }
     var cube = go as Cube;
     if (cube != null)
     {
         Visit(cube);
         return;
     }
     var sphere = go as Sphere;
     if (sphere != null)
     {
         Visit(sphere);
         return;
     }
     Visit(go);
 }
Exemple #3
0
 public virtual void Visit(GraphicsObject go)
 {
 }
Exemple #4
0
 public void Traverse(GraphicsObject go)
 {
     VisitNode visitNode;
     if (_visitors.TryGetValue(go.GetType(), out visitNode))
     {
         visitNode(go);
     }
     else
     {
         Visit(go);
     }
 }