// Copyright (c) AlphaSierraPapa for the SharpDevelop Team (for details please see \doc\copyright.txt) // This code is distributed under the BSD license (for details please see \src\AddIns\Debugger\Debugger.AddIn\license.txt) using Expression = ICSharpCode.NRefactory.Ast.Expression; using System; using System.Collections.Generic; using System.Linq; using System.Text; using Debugger.AddIn.Visualizers.Utils; namespace Debugger.AddIn.Visualizers.Graph { /// /// Node in the . /// public class ObjectGraphNode { /// /// Permanent reference to the value in the the debugee this node represents. /// Needed for graph building and matching, since hashCodes are not unique. /// internal Debugger.Value PermanentReference { get; set; } /// /// Hash code in the debuggee of the DebuggerValue this node represents. /// internal int HashCode { get; set; } /// /// Expression used to obtain this node. /// public Expression Expression { get; set; } /// /// Property tree of this node. /// public ThisNode Content { get; set; } /// /// Name of the Type in the debuggee. /// public string TypeName { get; set; } /// /// All ObjectGraphProperties in the property tree of this node. /// public IEnumerable Properties { get { return this.Content.FlattenPropertyNodes().Select(node => {return node.Property; }); } } /// /// Same as but sorted so that .NET properties come first, and .NET fields after them. /// public IEnumerable PropertiesFirstThenFields { get { return this.Properties.OrderBy(prop => prop.MemberInfo, PropertiesFirstComparer.Instance); } } } }