コード例 #1
0
ファイル: BoxLink.cs プロジェクト: fbizuneh/Igor
 public virtual bool IsConnecting(Anchor <EntityType> TestAnchor)
 {
     return(TestAnchor == StartAnchor || TestAnchor == EndAnchor);
 }
コード例 #2
0
ファイル: EntityBox.cs プロジェクト: fbizuneh/Igor
        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();
        }
コード例 #3
0
ファイル: BoxLink.cs プロジェクト: fbizuneh/Igor
 public BoxLink(Anchor <EntityType> FromAnchor)
 {
     StartAnchor = FromAnchor;
     EndAnchor   = null;
 }
コード例 #4
0
ファイル: EntityBox.cs プロジェクト: fbizuneh/Igor
 public virtual void CanConnectNodes(Anchor <EntityType> InputNode, Anchor <EntityType> OutputNode)
 {
 }