Esempio n. 1
0
        public void CreateConnection(IRelation target, ConnectionType connectionType = ConnectionType.OneWay)
        {
            var r = ConnectionList.FirstOrDefault(v => v.TargetObjectID == target.ObjectID);

            if (r != null)
            {
                ConnectionList.Remove(r);
            }
            var sObj = NodeList.FirstOrDefault(v => v.TargetObjectID == target.SourceID);
            var tObj = NodeList.FirstOrDefault(v => v.TargetObjectID == target.TargetID);

            if (sObj == null || tObj == null)
            {
                return;
            }
            CreateConnection(sObj, tObj, connectionType);
        }