PostSharp 6.10 / / Post­Sharp Documentation / API Reference / Post­Sharp.​Patterns.​Utilities Namespace / Unknown­Object­Accessor Structure

UnknownObjectAccessor Structure

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

Namespace:  PostSharp.Patterns.Utilities
Assembly:  PostSharp.Patterns.Common (in PostSharp.Patterns.Common.dll) Version: 6.10.5.0 (6.10.5.0)
Syntax
C#
public readonly struct UnknownObjectAccessor : IEquatable<UnknownObjectAccessor>, 
	IEnumerable<KeyValuePair<string, Object>>, IEnumerable

The UnknownObjectAccessor type exposes the following members.

Methods
  NameDescription
Public methodEquals(Object)
Indicates whether this instance and a specified object are equal.
(Overrides ValueType.Equals(Object).)
Public methodEquals(UnknownObjectAccessor)
Indicates whether the current object is equal to another object of the same type.
Public methodGetEnumerator
Returns an UnknownObjectAccessor.Enumerator, which enumerates properties of the current UnknownObjectAccessor as a set of KeyValuePair<string, object>.
Public methodStatic memberGetFactory(Type)
Gets a delegate to a factory method that returns a UnknownObjectAccessor for an object of a type given as a generic parameter.
Public methodStatic memberGetFactory<T>()
Gets a delegate to a factory method that returns a UnknownObjectAccessor for an object of a type given as a generic parameter.
Public methodGetHashCode
Returns the hash code for this instance.
(Overrides ValueType.GetHashCode().)
Public methodStatic memberGetInstance
Gets an UnknownObjectAccessor for a specific object.
Public methodToTuples
Converts the wrapped object to an array of name-value tuples.
Public methodTryGetProperty<T>(String, T)
Gets the value of a named property for the current UnknownObjectAccessor.
Public methodStatic memberTryGetProperty<T>(Object, String, T)
Gets the value of a named property for an arbitrary object.
Public methodVisitProperties<TState>
Invokes the Visit<TValue>(String, TValue, TState) method of a given visitor for each property of the current UnknownObjectAccessor.
Operators
  NameDescription
Public operatorStatic memberEquality
Determines if two UnknownObjectAccessor are equal.
Public operatorStatic memberInequality
Determines if two UnknownObjectAccessor are different.
Extension Methods
  NameDescription
Public Extension MethodToAdvisableCollection<KeyValuePair<String, Object>>
Converts an IEnumerable<T> into an AdvisableCollection<T>.
(Defined by Extensions.)
Public Extension MethodToAdvisableDictionary<KeyValuePair<String, Object>, TKey, TValue>
Converts an IEnumerable<T> into a AdvisableDictionary<TKey, TValue> given a method returning the item key and a method returning the item value.
(Defined by Extensions.)
Public Extension MethodToAdvisableHashSet<KeyValuePair<String, Object>>
Converts an IEnumerable<T> into an AdvisableHashSet<T>.
(Defined by Extensions.)
See Also