예제 #1
0
        /// <summary>
        /// Initializes a new graph node.
        /// </summary>
        /// <param name="id">The specified node id.</param>
        /// <param name="value">The specified node value.</param>
        /// <param name="graph">The graph that tracks this node.</param>
        public GraphNode(NodeId id, T value, GraphDiagram <T, E> graph)
        {
            if (null == id)
            {
                throw new ArgumentNullException();
            }

            if (null == value)
            {
                throw new ArgumentNullException();
            }

            if (null == graph)
            {
                throw new ArgumentNullException();
            }

            this.id    = id;
            this.value = value;
            this.graph = graph;
        }
예제 #2
0
 /// <summary>
 /// Initializes a new graph node with a unique id.
 /// </summary>
 /// <param name="value">The specified node value.</param>
 /// <param name="graph">The graph that tracks this node.</param>
 public GraphNode(T value, GraphDiagram <T, E> graph)
     : this(new NodeId(), value, graph)
 {
 }