Open sandboxFocus

Struct UnknownObjectAccessor

A convenience wrapper for instances of anonymous types (or any unknown type) that exposes properties.

Namespace: PostSharp.Patterns.Utilities
Assembly: PostSharp.Patterns.Common.dll
Syntax
public readonly struct UnknownObjectAccessor : IEquatable<UnknownObjectAccessor>, IEnumerable<KeyValuePair<string, object>>, IEnumerable

Methods

Name Description
Equals(UnknownObjectAccessor)
Equals(object)
GetEnumerator()

Returns an UnknownObjectAccessor.Enumerator, which enumerates properties of the current UnknownObjectAccessor as a set of KeyValuePair<string, object>.

GetFactory(Type)

Gets a delegate to a factory method that returns a UnknownObjectAccessor for an object of a type given as a generic parameter.

GetFactory<T>()

Gets a delegate to a factory method that returns a UnknownObjectAccessor for an object of a type given as a generic parameter.

GetHashCode()
GetInstance(object)

Gets an UnknownObjectAccessor for a specific object.

ToTuples()

Converts the wrapped object to an array of name-value tuples.

TryGetProperty<T>(object, string, out T)

Gets the value of a named property for an arbitrary object.

TryGetProperty<T>(string, out T)

Gets the value of a named property for the current UnknownObjectAccessor.

VisitProperties<TState>(IUnknownObjectPropertyVisitor<TState>, ref TState)

Invokes the Visit<TValue>(string, TValue, ref TState) method of a given visitor for each property of the current UnknownObjectAccessor.

Operators

Name Description
operator ==(UnknownObjectAccessor, UnknownObjectAccessor)

Determines if two UnknownObjectAccessor are equal.

operator !=(UnknownObjectAccessor, UnknownObjectAccessor)

Determines if two UnknownObjectAccessor are different.

Extension Methods