Ejemplo n.º 1
0
        private void linkToolStripMenuItem_Click(object sender, EventArgs e)
        {
            if (SelectedInputPoint == null ||
                SelectedOutputPoint == null ||
                SelectedInputPoint.LinkedTo != null ||
                SelectedInputPoint.LinkType != SelectedOutputPoint.LinkType
                )
            {
                return;
            }

            if (SelectedInputPoint.HolderPanel.IsInChain(SelectedOutputPoint.HolderPanel))
            {
                return;
            }

            OnDataUpdated();

            SelectedInputPoint.LinkTo(SelectedOutputPoint);
            SelectedInputPoint.IsSelected = false;
            SelectedInputPoint            = null;

            SelectedOutputPoint.IsSelected = false;
            SelectedOutputPoint            = null;

            mainPanel.Invalidate();
            mainPanel.Update();
        }
Ejemplo n.º 2
0
        public STMBlockInkInfo(LinkPoint p)
        {
            if (p.Direction == enLinkDirection.Input)
            {
                var pp = p.LinkedTo;

                if (pp != null)
                {
                    Name      = p.Name;
                    DataIndex = pp.DataMapIdx;
                }
                else
                {
                    DataIndex = 0;
                }
            }
            else
            {
                Name      = p.Name;
                DataIndex = p.DataMapIdx;
            }

            LinkDirection = p.Direction;
            LinkType      = p.LinkType;
        }
Ejemplo n.º 3
0
        private void OnPanelLinkSelected(object sender, LinkSelectArgumetns e)
        {
            if (!e.ToState)
            {
                switch (e.Link.Direction)
                {
                case enLinkDirection.Input:
                    SelectedInputPoint = null;

                    mainPanel.Invalidate();
                    mainPanel.Update();

                    break;

                case enLinkDirection.Output:
                    SelectedOutputPoint = null;
                    break;
                }

                return;
            }

            switch (e.Link.Direction)
            {
            case enLinkDirection.Input:
                if (SelectedInputPoint != null)
                {
                    SelectedInputPoint.IsSelected = false;
                }
                SelectedInputPoint = e.Link;

                mainPanel.Invalidate();
                mainPanel.Update();

                break;

            case enLinkDirection.Output:
                if (SelectedOutputPoint != null)
                {
                    SelectedOutputPoint.IsSelected = false;
                }
                SelectedOutputPoint = e.Link;
                break;
            }



            CheckLinkMI();
        }
Ejemplo n.º 4
0
        public void LinkTo(LinkPoint link)
        {
            if (Direction == enLinkDirection.Output)
            {
                return;
            }

            if (_linkedTo != null)
            {
                _linkedTo.SetLink(null);
            }

            SetLink(link);
            _linkedTo.SetLink(this);
        }
Ejemplo n.º 5
0
        private void SetLink(LinkPoint link)
        {
            _linkedTo = link;

            if (_linkedTo != null)
            {
                __LinkedToID       = _linkedTo.HolderPanel.ID;
                __LinkedTOLinkName = _linkedTo.Name;
            }
            else
            {
                __LinkedToID       = Guid.Empty;
                __LinkedTOLinkName = null;
            }

            OnLinkedToChanged();
        }
Ejemplo n.º 6
0
        private void Panel_Click(object sender, EventArgs e)
        {
            foreach (var el in __Elements)
            {
                el.IsSelected = false;
            }
            if (SelectedInputPoint != null)
            {
                SelectedInputPoint.IsSelected = false;
                SelectedInputPoint            = null;
            }

            if (SelectedOutputPoint != null)
            {
                SelectedOutputPoint.IsSelected = false;
                SelectedOutputPoint            = null;
            }

            CheckLinkMI();
        }
Ejemplo n.º 7
0
 public LinkSelectArgumetns(LinkPoint link, bool toState)
 {
     Link    = link;
     ToState = toState;
 }