Ejemplo n.º 1
0
        protected virtual void OnRelationAdded(BlockRelation relation)
        {
            var handler = this.RelationAdded;

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

            ModelingDesigner.SetComponent(con, relation);

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