private void OperationNode(object sender, NodeChangeEventArg e) { if (e.oper == Operations.ADD) { FrameworkElement obj; switch (e.Node.NodeType) { case 0: { obj = new Aerocraft(); break; } case 1: { obj = new Boat(); break; } case 2: { obj = new Vehicle(); break; } default: { obj = new Vehicle(); break; } } this.tileCanvas.AddSingleObject(e.Node.ToString(), obj, e.Node); } else if (e.oper == Operations.DEL) { this.tileCanvas.DelSubObject(e.Node.ToString()); } }
private void OnNodeChanged(object sender, NodeChangeEventArg e) { NodeChangedEvent(this, e); }