protected virtual void OnRelationAdded(BlockRelation relation) { var handler = this.RelationAdded; if (handler != null) { handler(this, new RelationAddedEventArgs(relation)); } }
private void AddConnectionIntoCanvas(BlockRelation relation) { var con = relation.CreateConnection(); ModelingDesigner.SetComponent(con, relation); //从 0 开始添加,可以保证连接显示在元素之后。 _canvas.Children.Insert(0, con); }
private void _canvas_DragLineCompleted(object sender, CanvasDragLineCompletedEventArgs e) { var source = BlockControl.GetBlockControl(e.Source); var sink = BlockControl.GetBlockControl(e.Sink); var relation = new BlockRelation { FromBlock = source.TypeFullName, ToBlock = sink.TypeFullName }; this.Relations.Insert(0, relation); this.OnRelationAdded(relation); }
public RelationAddedEventArgs(BlockRelation relation) { this.Relation = relation; }
private void RemoveConnectionFromCanvas(BlockRelation con) { _canvas.Children.Remove(con.EngineControl); }