Beispiel #1
0
        protected virtual void OnRelationAdded(BlockRelation relation)
        {
            var handler = this.RelationAdded;

            if (handler != null)
            {
                handler(this, new RelationAddedEventArgs(relation));
            }
        }
Beispiel #2
0
        private void AddConnectionIntoCanvas(BlockRelation relation)
        {
            var con = relation.CreateConnection();

            ModelingDesigner.SetComponent(con, relation);

            //从 0 开始添加,可以保证连接显示在元素之后。
            _canvas.Children.Insert(0, con);
        }
Beispiel #3
0
        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);
        }
Beispiel #4
0
 public RelationAddedEventArgs(BlockRelation relation)
 {
     this.Relation = relation;
 }
Beispiel #5
0
 private void RemoveConnectionFromCanvas(BlockRelation con)
 {
     _canvas.Children.Remove(con.EngineControl);
 }