Class WrapMemberAttribute
- Namespace
- EzrSquared.Runtime.Types.Wrappers
- Assembly
- ezrSquared-lib.dll
Attribute for C# types and members to be automatically wrapped from C# types into ezr² types.
[AttributeUsage(AttributeTargets.Class|AttributeTargets.Struct|AttributeTargets.Constructor|AttributeTargets.Method|AttributeTargets.Property|AttributeTargets.Field, AllowMultiple = false, Inherited = false)]
public class WrapMemberAttribute : Attribute- Inheritance
- 
      objectAttributeWrapMemberAttribute
Constructors
WrapMemberAttribute(bool, bool)
Creates a new WrapMemberAttribute.
public WrapMemberAttribute(bool isReadOnly = false, bool isWriteOnly = false)Parameters
- isReadOnlybool
- Is the member read-only? Only for properties and fields. 
- isWriteOnlybool
- Is the member write-only? Only for properties and fields. 
Exceptions
- ArgumentException
- Thrown if both IsReadOnly and IsWriteOnly are set to true. 
WrapMemberAttribute(string, bool, bool)
Creates a new WrapMemberAttribute.
public WrapMemberAttribute(string name, bool isReadOnly = false, bool isWriteOnly = false)Parameters
- namestring
- The ezr² name for the member. 
- isReadOnlybool
- Is the member read-only? Only for properties and fields. 
- isWriteOnlybool
- Is the member write-only? Only for properties and fields. 
Fields
IsReadOnly
Is the member read-only? Only for properties and fields.
public readonly bool IsReadOnlyField Value
- bool
IsWriteOnly
Is the member write-only? Only for properties and fields.
public readonly bool IsWriteOnlyField Value
- bool
Name
The ezr² name for the member.
public readonly string NameField Value
- string
Methods
GetIsPublic(MemberInfo)
Is the member publicly accessible in some way?
public static bool GetIsPublic(MemberInfo member)Parameters
- memberMemberInfo
- The member to check. 
Returns
Exceptions
- ArgumentException
- If - memberis of an unknown or unsupported type.
ShouldBeWrapped(MemberInfo)
Is the member eligible to be wrapped?
public static bool ShouldBeWrapped(MemberInfo member)Parameters
- memberMemberInfo
- The member to be wrapped. 
Returns
ValidateMethod(MethodBase, bool)
Checks if the given method has the supported signature for wrapping.
public static bool ValidateMethod(MethodBase methodBase, bool dontThrow = false)Parameters
- methodBaseMethodBase
- The method. 
- dontThrowbool
- Disable exception throwing. 
Returns
Exceptions
- ArgumentException
- Thrown if the method is generic or has generic parameters. 
ValidateType(Type, bool)
Checks if the given type has the supported signature for wrapping.
public static bool ValidateType(Type type, bool dontThrow = false)Parameters
- typeType
- The type. 
- dontThrowbool
- Disable exception throwing. 
Returns
Exceptions
- ArgumentException
- Thrown if the type is generic or has generic parameters.