Exemplo n.º 1
0
 protected override void OnComponentRemoved(Component component)
 {
     if (component == this.mover)
         this.mover = null;
     if (component == this.shape)
         this.shape = null;
     base.OnComponentRemoved(component);
 }
Exemplo n.º 2
0
 protected override void OnComponentAdded(Component component)
 {
     base.OnComponentAdded(component);
     if (component is Mover)
     {
         if (this.mover != null)
             this.RemoveComponent(this.mover);
         this.mover = component as Mover;
     }
     if (component is Shape)
     {
         if (this.shape != null)
             this.RemoveComponent(this.shape);
         this.shape = component as Shape;
     }
 }