Beispiel #1
0
 public virtual bool IsConnecting(Anchor <EntityType> TestAnchor)
 {
     return(TestAnchor == StartAnchor || TestAnchor == EndAnchor);
 }
Beispiel #2
0
        public virtual void UpdateAnchors()
        {
            if (WrappedInstance != null)
            {
                WrappedInstance.CreateStaticNodesIfNotPresent();
            }

            List <Anchor <EntityType> > DeletedList = new List <Anchor <EntityType> >();

            DeletedList.AddRange(Inputs);

            foreach (EntityLink <EntityType> InputLink in GetInputEvents())
            {
                bool bHasAnchor = false;
                foreach (Anchor <EntityType> CurrentAnchor in Inputs)
                {
                    if (CurrentAnchor.GetLabelText() == InputLink.Name)
                    {
                        bHasAnchor = true;
                        DeletedList.Remove(CurrentAnchor);
                    }
                }
                if (!bHasAnchor)
                {
                    Anchor <EntityType> InputAnchor = new Anchor <EntityType>(InputLink.Name, GetAnchorText(InputLink), new Anchor <EntityType> .AnchorType(true), this);
                    Inputs.Add(InputAnchor);
                }
            }

            foreach (Anchor <EntityType> DeletedItem in DeletedList)
            {
                DeletedItem.CleanupBeforeRemoval();
                Owner.BreakAllConnectionsForAnchor(DeletedItem);
                Inputs.Remove(DeletedItem);
            }

            DeletedList.Clear();
            DeletedList.AddRange(Outputs);

            foreach (EntityLink <EntityType> OutputLink in GetOutputEvents())
            {
                bool bHasAnchor = false;
                foreach (Anchor <EntityType> CurrentAnchor in Outputs)
                {
                    if (CurrentAnchor.GetLabelText() == OutputLink.Name)
                    {
                        bHasAnchor = true;
                        DeletedList.Remove(CurrentAnchor);
                    }
                }
                if (!bHasAnchor)
                {
                    Anchor <EntityType> OutputAnchor = new Anchor <EntityType>(OutputLink.Name, GetAnchorText(OutputLink), new Anchor <EntityType> .AnchorType(false), this);
                    Outputs.Add(OutputAnchor);
                }
            }

            foreach (Anchor <EntityType> DeletedItem in DeletedList)
            {
                DeletedItem.CleanupBeforeRemoval();
                Owner.BreakAllConnectionsForAnchor(DeletedItem);
                Outputs.Remove(DeletedItem);
            }

            DeletedList.Clear();
        }
Beispiel #3
0
 public BoxLink(Anchor <EntityType> FromAnchor)
 {
     StartAnchor = FromAnchor;
     EndAnchor   = null;
 }
Beispiel #4
0
 public virtual void CanConnectNodes(Anchor <EntityType> InputNode, Anchor <EntityType> OutputNode)
 {
 }