public void SetCollapsed(Expression expression) { expanded.SetCollapsed(expression.PrettyPrint()); }
/// <summary> /// Evaluates System.Collections.ICollection.Count property on given object. /// </summary> /// <exception cref="GetValueException">Evaluating System.Collections.ICollection.Count on targetObject failed.</exception> public static int GetIListCount(Expression targetObject) { Value list = targetObject.Evaluate(WindowsDebugger.CurrentProcess); var iCollectionInterface = list.Type.GetInterface(typeof(ICollection).FullName); if (iCollectionInterface == null) throw new GetValueException(targetObject, targetObject.PrettyPrint() + " does not implement System.Collections.ICollection"); PropertyInfo countProperty = iCollectionInterface.GetProperty("Count"); // Do not get string representation since it can be printed in hex return (int)list.GetPropertyValue(countProperty).PrimitiveValue; }
public bool IsExpanded(Expression expression) { return expanded.IsExpanded(expression.PrettyPrint()); }