Esempio n. 1
0
 /// <summary>
 /// Iterates the node relation of source list set.
 /// </summary>
 /// <param name="item">The item.</param>
 /// <returns></returns>
 public System.Collections.Generic.IEnumerable <NodeRelationDescriptor> IterateNodeRelationOfSourceListSetItem(SourceListSetEntry item)
 {
     foreach (NodeRelationDescriptor nRelation in this.Relations)
     {
         if (nRelation.ChildSourceName == item.SourceName)
         {
             yield return(nRelation);
         }
     }
 }
Esempio n. 2
0
 /// <summary>
 /// Initializes a new instance of the <see cref="SourceListSetEventArgs"/>.
 /// </summary>
 /// <param name="source">Name of the source.</param>
 /// <param name="collectionChangedType">Type of the collection changed.</param>
 public SourceListSetEventArgs(SourceListSetEntry source, CollectionChangedType collectionChangedType)
 {
     this._source = source;
     this._collectionChangedType = collectionChangedType;
 }
Esempio n. 3
0
        private void ProcessConnection(NodeRelationDescriptor nodeRelation, SourceListSetEntry childSourceList, SourceListSetEntry parentSourceList, object item)
        {
            ConnectorBase connector  = null;
            Node          parentNode = GetParentNodeFromSourceListSet(parentSourceList, item, nodeRelation.ChildID, nodeRelation.ParentID);
            Node          childNode  = GetChildNodeFromSourceListSet(childSourceList, item);

            if (parentNode != null && childNode != null && !CheckParentAndChildNodeAlreadyConnected(parentNode, childNode))
            {
                if (!isNodeConnectStyleListening)
                {
                    //Connect nodes
                    connector = ConnectNodes(parentNode, childNode);
                }
                else
                {
                    //Raise the event to customize the connectors
                    connector = RaiseQueryNodeConnectorStyleInfoHandler(nodeRelation, parentNode, childNode);
                }
            }
            //Append the Connector to the DiagramModel.
            if (connector != null)
            {
                Diagram.Model.AppendChild(connector);
                Diagram.Model.SendToBack(connector);
                nodeRelation.nodeConnections.Add(connector);
            }
        }