Skip to content
ConsoleMonster
Class

InspectorOptions

ConsoleMonster.Data

Namespace
ConsoleMonster.Data
Assembly
ConsoleMonster
Modifiers
sealed
Attributes
Fluent

Controls depth, collection, member filtering and member source selection.

Inheritance

  • object
  • InspectorOptions

Usage

Explore 59 API references to this type

This type appears in these public API surfaces even when no hand-authored example is attached directly to the page.

Accepted by parameters 32

Constructors

public InspectorOptions() #

Methods

public static int DefaultDepthFor(int fieldCount, int narrowDepth = 3) #

The depth a tree starts with for an object when none is asked for: wide objects (more than InspectorOptions.WideObjectFields members, such as a process or a file) open one level, since every nested level multiplies their size; small records and parsed JSON open narrowDepth levels.

Parameters

fieldCount int required
The number of members the object shows.
narrowDepth int = 3 optional
The depth for objects that are not wide (default 3).

Returns

int The depth.

Properties

public int MaxDepth { get; set; } #

Maximum node depth below the root.

public int MaxItems { get; set; } #

Maximum collection items listed.

public int MaxColumns { get; set; } #

Maximum tabular columns exposed.

public int MaxNodes { get; set; } #

Maximum nodes in one inspection (default 5,000). Wide objects grow as members to the power of depth; once the budget is spent, the inspector adds one "node limit reached" marker and stops reading further members and items.

public IList<string> Include { get; } #

Optional member-name wildcard allow list.

public IList<string> Exclude { get; } #

Optional member-name wildcard deny list. Excluded members are never read, so this is also the skip list for getters that are slow, block or have side effects.

public IList<string> Order { get; } #

Member names to place first, in listed order.

public bool UseReflection { get; set; } #

Whether public-property reflection is used as the final built-in source.

public IList<IMemberSource> Sources { get; } #

Custom sources, consulted before built-in sources.

public Func<object, object>? Unwrap { get; set; } #
Fluent("UnwrapBy")

Optional host callback applied to each non-null value before the inspector classifies it. Use this to strip host wrapper objects while preserving the wrapped value's identity for cycle detection.

public Func<object, object>? Identity { get; set; } #
Fluent("IdentityBy")

Optional host callback that gives the identity of a value for cycle detection (for example the object a host wrapper wraps, since a new wrapper can be created for every read), or null to use the value itself.

public TimeSpan TimeBudget { get; set; } #

How long one inspection may spend reading values (default 2 seconds; zero or less for no limit).

Fields

public const int WideObjectFields #

The member count above which an object counts as wide for InspectorOptions.DefaultDepthFor (12).

Value: 12

Extension Methods

Exclude 2 overloads
public static InspectorOptions Exclude(InspectorOptions inspectorOptions, string item) #

Adds an item to InspectorOptions.Exclude: Optional member-name wildcard deny list. Excluded members are never read, so this is also the skip list for getters that are slow, block or have side effects.

Parameters

inspectorOptions ConsoleMonster.Data.InspectorOptions required
The instance.
item string required
The item.

Returns

InspectorOptions The same instance.
public static InspectorOptions Exclude(InspectorOptions inspectorOptions, IEnumerable<string> items) #

Adds items to InspectorOptions.Exclude: Optional member-name wildcard deny list. Excluded members are never read, so this is also the skip list for getters that are slow, block or have side effects.

Parameters

inspectorOptions ConsoleMonster.Data.InspectorOptions required
The instance.
items System.Collections.Generic.IEnumerable<string> required
The items, in order.

Returns

InspectorOptions The same instance.
public static InspectorOptions IdentityBy(InspectorOptions inspectorOptions, Func<object, object>? value) #

Sets InspectorOptions.Identity: Optional host callback that gives the identity of a value for cycle detection (for example the object a host wrapper wraps, since a new wrapper can be created for every read), or null to use the value itself.

Parameters

inspectorOptions ConsoleMonster.Data.InspectorOptions required
The instance.
value System.Func<object, object>? required
The callback.

Returns

InspectorOptions The same instance.

Examples

// C# initializer or property                                             // C# fluent
new global::ConsoleMonster.Data.InspectorOptions { Identity = value };    inspectorOptions.IdentityBy(value);
Include 2 overloads
public static InspectorOptions Include(InspectorOptions inspectorOptions, string item) #

Adds an item to InspectorOptions.Include: Optional member-name wildcard allow list.

Parameters

inspectorOptions ConsoleMonster.Data.InspectorOptions required
The instance.
item string required
The item.

Returns

InspectorOptions The same instance.
public static InspectorOptions Include(InspectorOptions inspectorOptions, IEnumerable<string> items) #

Adds items to InspectorOptions.Include: Optional member-name wildcard allow list.

Parameters

inspectorOptions ConsoleMonster.Data.InspectorOptions required
The instance.
items System.Collections.Generic.IEnumerable<string> required
The items, in order.

Returns

InspectorOptions The same instance.
public static InspectorOptions MaxColumns(InspectorOptions inspectorOptions, int value) #

Sets InspectorOptions.MaxColumns: Maximum tabular columns exposed.

Parameters

inspectorOptions ConsoleMonster.Data.InspectorOptions required
The instance.
value int required
The value.

Returns

InspectorOptions The same instance.

Examples

// C# initializer or property                                               // C# fluent
new global::ConsoleMonster.Data.InspectorOptions { MaxColumns = value };    inspectorOptions.MaxColumns(value);
public static InspectorOptions MaxDepth(InspectorOptions inspectorOptions, int value) #

Sets InspectorOptions.MaxDepth: Maximum node depth below the root.

Parameters

inspectorOptions ConsoleMonster.Data.InspectorOptions required
The instance.
value int required
The value.

Returns

InspectorOptions The same instance.

Examples

// C# initializer or property                                             // C# fluent
new global::ConsoleMonster.Data.InspectorOptions { MaxDepth = value };    inspectorOptions.MaxDepth(value);
public static InspectorOptions MaxItems(InspectorOptions inspectorOptions, int value) #

Sets InspectorOptions.MaxItems: Maximum collection items listed.

Parameters

inspectorOptions ConsoleMonster.Data.InspectorOptions required
The instance.
value int required
The value.

Returns

InspectorOptions The same instance.

Examples

// C# initializer or property                                             // C# fluent
new global::ConsoleMonster.Data.InspectorOptions { MaxItems = value };    inspectorOptions.MaxItems(value);
public static InspectorOptions MaxNodes(InspectorOptions inspectorOptions, int value) #

Sets InspectorOptions.MaxNodes: Maximum nodes in one inspection (default 5,000). Wide objects grow as members to the power of depth; once the budget is spent, the inspector adds one "node limit reached" marker and stops reading further members and items.

Parameters

inspectorOptions ConsoleMonster.Data.InspectorOptions required
The instance.
value int required
The value.

Returns

InspectorOptions The same instance.

Examples

// C# initializer or property                                             // C# fluent
new global::ConsoleMonster.Data.InspectorOptions { MaxNodes = value };    inspectorOptions.MaxNodes(value);
Order 2 overloads
public static InspectorOptions Order(InspectorOptions inspectorOptions, string item) #

Adds an item to InspectorOptions.Order: Member names to place first, in listed order.

Parameters

inspectorOptions ConsoleMonster.Data.InspectorOptions required
The instance.
item string required
The item.

Returns

InspectorOptions The same instance.
public static InspectorOptions Order(InspectorOptions inspectorOptions, IEnumerable<string> items) #

Adds items to InspectorOptions.Order: Member names to place first, in listed order.

Parameters

inspectorOptions ConsoleMonster.Data.InspectorOptions required
The instance.
items System.Collections.Generic.IEnumerable<string> required
The items, in order.

Returns

InspectorOptions The same instance.
public static InspectorOptions Source(InspectorOptions inspectorOptions, IMemberSource item) #

Adds an item to InspectorOptions.Sources: Custom sources, consulted before built-in sources.

Parameters

inspectorOptions ConsoleMonster.Data.InspectorOptions required
The instance.
item ConsoleMonster.Data.IMemberSource required
The item.

Returns

InspectorOptions The same instance.
public static InspectorOptions Sources(InspectorOptions inspectorOptions, IEnumerable<IMemberSource> items) #

Adds items to InspectorOptions.Sources: Custom sources, consulted before built-in sources.

Parameters

inspectorOptions ConsoleMonster.Data.InspectorOptions required
The instance.
items System.Collections.Generic.IEnumerable<ConsoleMonster.Data.IMemberSource> required
The items, in order.

Returns

InspectorOptions The same instance.
public static InspectorOptions TimeBudget(InspectorOptions inspectorOptions, TimeSpan value) #

Sets InspectorOptions.TimeBudget: How long one inspection may spend reading values (default 2 seconds; zero or less for no limit).

Parameters

inspectorOptions ConsoleMonster.Data.InspectorOptions required
The instance.
value System.TimeSpan required
The value.

Returns

InspectorOptions The same instance.

Examples

// C# initializer or property                                               // C# fluent
new global::ConsoleMonster.Data.InspectorOptions { TimeBudget = value };    inspectorOptions.TimeBudget(value);
public static InspectorOptions UnwrapBy(InspectorOptions inspectorOptions, Func<object, object>? value) #

Sets InspectorOptions.Unwrap: Optional host callback applied to each non-null value before the inspector classifies it. Use this to strip host wrapper objects while preserving the wrapped value's identity for cycle detection.

Parameters

inspectorOptions ConsoleMonster.Data.InspectorOptions required
The instance.
value System.Func<object, object>? required
The callback.

Returns

InspectorOptions The same instance.

Examples

// C# initializer or property                                           // C# fluent
new global::ConsoleMonster.Data.InspectorOptions { Unwrap = value };    inspectorOptions.UnwrapBy(value);
public static InspectorOptions UseReflection(InspectorOptions inspectorOptions, bool value = true) #

Sets InspectorOptions.UseReflection: Whether public-property reflection is used as the final built-in source.

Parameters

inspectorOptions ConsoleMonster.Data.InspectorOptions required
The instance.
value bool = true optional
The value; true when omitted.

Returns

InspectorOptions The same instance.

Examples

// C# initializer or property                                                  // C# fluent
new global::ConsoleMonster.Data.InspectorOptions { UseReflection = value };    inspectorOptions.UseReflection(value);