PostSharp 6.10 / / Post­Sharp Documentation / API Reference / Post­Sharp.​Patterns.​Diagnostics.​Contexts Namespace / Logging­Context Class / Logging­Context Methods / Logging­Context.​Visit­Properties Method / Logging­Context.​Visit­Properties Method (Action(String, Object), Boolean)

LoggingContext.VisitProperties Method (Action<String, Object>, Boolean)

Invokes a delegate each property on the current context, and, optionally, for inherited properties in ancestor contexts. This offers a simple way to visit properties, but it has a performance overhead compared to VisitProperties<TState>(ILoggingPropertyVisitor<TState>, TState, LoggingPropertyVisitorOptions) because it is weakly typed and cause the allocation of a closure class to build the action. It also does not expose the LoggingPropertyOptions.

Namespace:  PostSharp.Patterns.Diagnostics.Contexts
Assembly:  PostSharp.Patterns.Diagnostics (in PostSharp.Patterns.Diagnostics.dll) Version: (
public void VisitProperties(
	Action<string, Object> action,
	bool includeAncestors = true


Type: System.Action<String, Object>
The delegate to call for each property. The first value is the property name, the second its value.
includeAncestors (Optional)
Type: System.Boolean
Whether inherited properties of ancestor contexts should be visited too.
See Also