Example #1
0
        /// <summary>
        /// Attaches a parent edge to this node.
        /// </summary>
        /// <param name="edge">An object that implements the IOwlEdge interface.</param>
        /// <exception cref="ArgumentNullException">The specified edge is a null reference.</exception>
        public void AttachParentEdge(IOwlEdge edge)
        {
            if (edge == null)
            {
                throw (new ArgumentNullException());
            }
            bool         exists   = false;
            IOwlEdgeList edgeList = ParentEdges[edge.ID];

            foreach (OwlEdge e in edgeList)
            {
                // First, we will look for an edge which is having the same parent and
                // child as the one we want to add
                if (e.ParentNode == edge.ParentNode)
                {
                    exists = true;
                }
            }

            // If there is none, then we add the edge to this node
            if (!exists)
            {
                ParentEdges.Add(edge);
                edge.ChildNode = this;
            }
            // If not, then do nothing
        }
 public void AddDependencyEdge(DependencyEdge edge)
 {
     if (Equals(edge.Parent.DbObject, DbObject))
     {
         ChildEdges.Add(edge);
     }
     if (Equals(edge.Child.DbObject, DbObject))
     {
         ParentEdges.Add(edge);
     }
 }