PostSharp 6.10 / / Post­Sharp Documentation / API Reference / Post­Sharp.​Patterns.​Diagnostics.​Contexts Namespace / ILogging­Context Interface / ILogging­Context Methods / ILogging­Context.​For­Each­Property Method / ILogging­Context.​For­Each­Property(T) Method (Logging­Property­Visitor(T), T, Boolean)

ILoggingContext.ForEachProperty<T> Method (LoggingPropertyVisitor<T>, T, Boolean)

Note: This API is now obsolete.

Invokes a delegate for each property defined in the current logging context and optionally in its ancestor contexts, and specifies passes a state object to the delegate.

Namespace:  PostSharp.Patterns.Diagnostics.Contexts
Assembly:  PostSharp.Patterns.Common (in PostSharp.Patterns.Common.dll) Version: (
[ObsoleteAttribute("Use LoggingContext.VisitProperties.")]
void ForEachProperty<T>(
	LoggingPropertyVisitor<T> visitor,
	ref T state,
	bool includeAncestors = true


Type: PostSharp.Patterns.Diagnostics.Contexts.LoggingPropertyVisitor<T>
The delegate to invoke. The state parameter of the delegate will be assigned to a dummy variable.
Type: T
Some state that will be passed to the visitor delegate.
includeAncestors (Optional)
Type: System.Boolean
true if ancestor contexts should be visited, false if only the current context should be visited.

Type Parameters

Type of the state passed to the visitor delegate.

This method will visit all properties regardless of their name. If several properties have the same name, they will be visited several times.

See Also