Version 3.3.1.2

MemberAliasFieldInfo class

Namespace: Sirenix.Utilities
Assembly: Sirenix.Utilities
public sealed class MemberAliasFieldInfo : FieldInfo, ICustomAttributeProvider, _MemberInfo, _FieldInfo
Provides a methods of representing imaginary fields which are unique to serialization.

We aggregate the FieldInfo associated with this member and return a mangled form of the name.

Inheritance
  • System.Object
  • System.Reflection.MemberInfo
  • System.Reflection.FieldInfo
  • MemberAliasFieldInfo
See Also
  • System.Reflection.FieldInfo

Constructors

MemberAliasFieldInfo(FieldInfo, String)
Initializes a new instance of the MemberAliasFieldInfo class.
public MemberAliasFieldInfo(FieldInfo field, string namePrefix)
Parameters
System.Reflection.FieldInfo field

The field to alias.

System.String namePrefix

The name prefix to use.

MemberAliasFieldInfo(FieldInfo, String, String)
Initializes a new instance of the MemberAliasFieldInfo class.
public MemberAliasFieldInfo(FieldInfo field, string namePrefix, string separatorString)
Parameters
System.Reflection.FieldInfo field

The field to alias.

System.String namePrefix

The name prefix to use.

System.String separatorString

The separator string to use.

Properties

AliasedField
Gets the aliased field.
public FieldInfo AliasedField { get; }
Attributes
Gets the attributes.
public override FieldAttributes Attributes { get; }
DeclaringType
Gets the class that declares this member.
public override Type DeclaringType { get; }
FieldHandle
Gets a RuntimeFieldHandle, which is a handle to the internal metadata representation of a field.
public override RuntimeFieldHandle FieldHandle { get; }
FieldType
Gets the type of the field.
public override Type FieldType { get; }
MetadataToken
Gets a value that identifies a metadata element.
public override int MetadataToken { get; }
Module
Gets the module in which the type that declares the member represented by the current System.Reflection.MemberInfo is defined.
public override Module Module { get; }
Name
Gets the name of the current member.
public override string Name { get; }
ReflectedType
Gets the class object that was used to obtain this instance of MemberInfo.
public override Type ReflectedType { get; }

Methods

GetCustomAttributes(Boolean)
When overridden in a derived class, returns an array of all custom attributes applied to this member.
public override object[] GetCustomAttributes(bool inherit)
Parameters
System.Boolean inherit

True to search this member's inheritance chain to find the attributes; otherwise, false. This parameter is ignored for properties and events; see Remarks.

Returns
System.Object[]

An array that contains all the custom attributes applied to this member, or an array with zero elements if no attributes are defined.

GetCustomAttributes(Type, Boolean)
When overridden in a derived class, returns an array of custom attributes applied to this member and identified by System.Type.
public override object[] GetCustomAttributes(Type attributeType, bool inherit)
Parameters
System.Type attributeType

The type of attribute to search for. Only attributes that are assignable to this type are returned.

System.Boolean inherit

True to search this member's inheritance chain to find the attributes; otherwise, false. This parameter is ignored for properties and events; see Remarks.

Returns
System.Object[]

An array of custom attributes applied to this member, or an array with zero elements if no attributes assignable to attributeType have been applied.

GetValue(Object)
Gets the value of the field.
public override object GetValue(object obj)
Parameters
System.Object obj

The object instance to get the value from.

Returns
System.Object

The value of the field.

IsDefined(Type, Boolean)
When overridden in a derived class, indicates whether one or more attributes of the specified type or of its derived types is applied to this member.
public override bool IsDefined(Type attributeType, bool inherit)
Parameters
System.Type attributeType

The type of custom attribute to search for. The search includes derived types.

System.Boolean inherit

True to search this member's inheritance chain to find the attributes; otherwise, false. This parameter is ignored for properties and events; see Remarks.

Returns
System.Boolean

True if one or more instances of attributeType or any of its derived types is applied to this member; otherwise, false.

SetValue(Object, Object, BindingFlags, Binder, CultureInfo)
When overridden in a derived class, sets the value of the field supported by the given object.
public override void SetValue(object obj, object value, BindingFlags invokeAttr, Binder binder, CultureInfo culture)
Parameters
System.Object obj

The object whose field value will be set.

System.Object value

The value to assign to the field.

System.Reflection.BindingFlags invokeAttr

A field of Binder that specifies the type of binding that is desired (for example, Binder.CreateInstance or Binder.ExactBinding).

System.Reflection.Binder binder

A set of properties that enables the binding, coercion of argument types, and invocation of members through reflection. If binder is null, then Binder.DefaultBinding is used.

System.Globalization.CultureInfo culture

The software preferences of a particular culture.

Extension Methods