Ejemplo n.º 1
0
 private void AddLink(FlowGraphLink link)
 {
     if (!m_assignedLinks.Contains(link))
     {
         m_assignedLinks.Add(link);
         link.OnRemoved += Link_OnRemoved;
     }
 }
Ejemplo n.º 2
0
        //Event Handlers
        private void Link_OnRemoved(object sender, EventArgs e)
        {
            FlowGraphLink link = sender as FlowGraphLink;

            if (link != null)
            {
                if (m_assignedLinks.Contains(link))
                {
                    link.OnRemoved -= Link_OnRemoved;
                    m_assignedLinks.Remove(link);
                }
            }
        }
Ejemplo n.º 3
0
        public void RegisterLink(FlowGraphPort port, FlowGraphLink link)
        {
            FlowGraphPort.AssignLink(port, link);
            switch (port.Type)
            {
            case FlowGraphPort.PortType.InPort:
            {
                Rectangle portBounds = this.TranslatePortGrip(port);
                link.LinkEnd = new Point((portBounds.Left + (portBounds.Width / 2)),
                                         (portBounds.Top + (portBounds.Height / 2)));
            }
            break;

            case FlowGraphPort.PortType.OutPort:
            {
                Rectangle portBounds = this.TranslatePortGrip(port);
                link.LinkStart = new Point((portBounds.Left + (portBounds.Width / 2)),
                                           (portBounds.Top + (portBounds.Height / 2)));
            }
            break;
            }
        }
Ejemplo n.º 4
0
 public static void AssignLink(FlowGraphPort item, FlowGraphLink link)
 {
     item.AddLink(link);
 }