Exemplo n.º 1
0
    public bool Connect(Room room)
    {
        if (Neighbors.Contains(room))
        {
            return(true);
        }
        if (Neighbors.Count < Info.MaxConnections && room.Neighbors.Count < room.Info.MaxConnections)
        {
            var intersection = Bounds.Intersect(room.Bounds);
            if (intersection == null || (intersection.Width == 0 && intersection.Height >= 2) || (intersection.Height == 0 && intersection.Width >= 2))
            {
                var connectionPoint = GetConnectionPoint(room);
                if (connectionPoint == null)
                {
                    return(false);
                }
                ConnectionPoints.Add(room, connectionPoint.Value);
                room.ConnectionPoints.Add(this, connectionPoint.Value);
                Neighbors.Add(room);
                room.Neighbors.Add(this);

                return(true);
            }
        }
        return(false);
    }
Exemplo n.º 2
0
        public MessageBaseNode(IProductElementViewModel innerViewModel)
            : base(innerViewModel)
        {
            ConnectionPoints.Add(new DiagramConnectionPoint(this, Edge.Left));
            ConnectionPoints.Add(new DiagramConnectionPoint(this, Edge.Right));

            this.IsResizable = false;
            this.Bounds      = new Rect(0, 0, 320, 52);
        }
Exemplo n.º 3
0
        /// <summary>
        /// Default constructor.
        /// </summary>
        public TableElement()
        {
            Style.OutlineProperties.Rounding = rounding;
            Style.FillProperties.Color       = backgroundColor;

            PinPoint.PositionType = ElementPointPositionType.TopLeft;
            ConnectionPoints.Add(new ConnectionPoint(ConnectionPointType.InputOutput, ElementPointPositionType.TopRight));
            ConnectionPoints.Add(new ConnectionPoint(ConnectionPointType.InputOutput, ElementPointPositionType.TopCenter));
            ConnectionPoints.Add(new ConnectionPoint(ConnectionPointType.InputOutput, ElementPointPositionType.TopLeft));
            ConnectionPoints.Add(new ConnectionPoint(ConnectionPointType.InputOutput, ElementPointPositionType.BottomCenter));
            ConnectionPoints.Add(new ConnectionPoint(ConnectionPointType.InputOutput, ElementPointPositionType.BottomLeft));
            ConnectionPoints.Add(new ConnectionPoint(ConnectionPointType.InputOutput, ElementPointPositionType.BottomRight));

            //ConnectionPoints.Add(new ConnectionPoint(ConnectionPointType.InputOutput, ElementPointPositionType.Custom));
        }
Exemplo n.º 4
0
 public ChildNode(IProductElementViewModel innerViewModel)
     : base(innerViewModel)
 {
     ConnectionPoints.Add(new DiagramConnectionPoint(this, Edge.Left));
     ConnectionPoints.Add(new DiagramConnectionPoint(this, Edge.Right));
 }