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: 6.10.10.0 (6.10.10.0)
C#
public void VisitProperties( Action<string, Object> action, bool includeAncestors = true )
Parameters
- action
- 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.