/// <summary>
        /// Creates new node for the value.
        /// </summary>
        /// <param name="permanentReference">Value, has to be valid.</param>
        /// <returns>New empty object node representing the value.</returns>
        private ObjectGraphNode createNewNode(Value permanentReference, GraphExpression expression)
        {
            if (permanentReference == null)
            {
                throw new ArgumentNullException("permanentReference");
            }

            ObjectGraphNode newNode = new ObjectGraphNode();

            if (permanentReference.Type != null)
            {
                newNode.TypeName = permanentReference.Type.FormatNameCSharp();
            }
            newNode.HashCode = permanentReference.InvokeDefaultGetHashCode();

            resultGraph.AddNode(newNode);
            // remember this node's hashcode for quick lookup
            objectNodesForHashCode.Add(newNode.HashCode, newNode);

            // permanent reference to the object this node represents is useful for graph building,
            // and matching nodes in animations
            newNode.PermanentReference = permanentReference;
            newNode.Expression         = expression;

            return(newNode);
        }
Пример #2
0
        /// <summary>
        /// Creates new node for the value.
        /// </summary>
        /// <param name="permanentReference">Value, has to be valid.</param>
        /// <returns>New empty object node representing the value.</returns>
        private ObjectGraphNode createNewNode(Value permanentReference, Expression expression)
        {
            ObjectGraphNode newNode = new ObjectGraphNode();

            newNode.HashCode = permanentReference.InvokeDefaultGetHashCode();

            resultGraph.AddNode(newNode);
            // remember this node's hashcode for quick lookup
            objectNodesForHashCode.Add(newNode.HashCode, newNode);

            // permanent reference to the object this node represents is useful for graph building,
            // and matching nodes in animations
            newNode.PermanentReference = permanentReference;
            newNode.Expression         = expression;

            return(newNode);
        }