Class SerializableMember
Represents a member of a type to use when serializing.
Inheritance
System.Object
SerializableMember
Namespace: Cesil
Assembly: Cesil.dll
Syntax
public sealed class SerializableMember : Object, IEquatable<SerializableMember>
Properties
Name
The name of the column that maps to this member.
Declaration
public string Name { get; }
Property Value
Type |
Description |
System.String |
|
Methods
Create a SerializableMember with an explicit type being serialized, name, getter, formatter, ShouldSerialize method, and whether to emit a default value.
Declaration
public static SerializableMember Create(TypeInfo forType, string name, Getter getter, Formatter formatter, ShouldSerialize shouldSerialize, EmitDefaultValue emitDefault)
Parameters
Returns
Equals(SerializableMember)
Returns true if this object equals the given SerializableMember.
Declaration
public bool Equals(SerializableMember serializableMember)
Parameters
Returns
Type |
Description |
System.Boolean |
|
Equals(Object)
Returns true if this object equals the given SerializableMember.
Declaration
public override bool Equals(object obj)
Parameters
Type |
Name |
Description |
System.Object |
obj |
|
Returns
Type |
Description |
System.Boolean |
|
ForField(FieldInfo)
Creates a SerializableMember for the given field.
Declaration
public static SerializableMember ForField(FieldInfo field)
Parameters
Type |
Name |
Description |
System.Reflection.FieldInfo |
field |
|
Returns
ForField(FieldInfo, String)
Creates a SerializableMember for the given field, with the given name.
Declaration
public static SerializableMember ForField(FieldInfo field, string name)
Parameters
Type |
Name |
Description |
System.Reflection.FieldInfo |
field |
|
System.String |
name |
|
Returns
Creates a SerializableMember for the given field, with the given name and formatter.
Declaration
public static SerializableMember ForField(FieldInfo field, string name, Formatter formatter)
Parameters
Type |
Name |
Description |
System.Reflection.FieldInfo |
field |
|
System.String |
name |
|
Formatter |
formatter |
|
Returns
Creates a SerializableMember for the given field, with the given name, formatter, and ShouldSerialize method.
Declaration
public static SerializableMember ForField(FieldInfo field, string name, Formatter formatter, ShouldSerialize shouldSerialize)
Parameters
Type |
Name |
Description |
System.Reflection.FieldInfo |
field |
|
System.String |
name |
|
Formatter |
formatter |
|
ShouldSerialize |
shouldSerialize |
|
Returns
Creates a SerializableMember for the given field, with the given name, formatter, ShouldSerialize method, and whether to emit a default value.
Declaration
public static SerializableMember ForField(FieldInfo field, string name, Formatter formatter, ShouldSerialize shouldSerialize, EmitDefaultValue emitDefault)
Parameters
Returns
ForProperty(PropertyInfo)
Creates a SerializableMember for the given property.
Declaration
public static SerializableMember ForProperty(PropertyInfo property)
Parameters
Type |
Name |
Description |
System.Reflection.PropertyInfo |
property |
|
Returns
ForProperty(PropertyInfo, String)
Creates a SerializableMember for the given property, with the given name.
Declaration
public static SerializableMember ForProperty(PropertyInfo property, string name)
Parameters
Type |
Name |
Description |
System.Reflection.PropertyInfo |
property |
|
System.String |
name |
|
Returns
Creates a SerializableMember for the given property, with the given name and formatter.
Declaration
public static SerializableMember ForProperty(PropertyInfo property, string name, Formatter formatter)
Parameters
Type |
Name |
Description |
System.Reflection.PropertyInfo |
property |
|
System.String |
name |
|
Formatter |
formatter |
|
Returns
Creates a SerializableMember for the given property, with the given name, formatter, and ShouldSerialize method.
Declaration
public static SerializableMember ForProperty(PropertyInfo property, string name, Formatter formatter, ShouldSerialize shouldSerialize)
Parameters
Type |
Name |
Description |
System.Reflection.PropertyInfo |
property |
|
System.String |
name |
|
Formatter |
formatter |
|
ShouldSerialize |
shouldSerialize |
|
Returns
Creates a SerializableMember for the given property, with the given name, formatter, ShouldSerialize method, and whether to emit a default value.
Declaration
public static SerializableMember ForProperty(PropertyInfo property, string name, Formatter formatter, ShouldSerialize shouldSerialize, EmitDefaultValue emitDefault)
Parameters
Returns
GetHashCode()
Returns a stable hash for this SerializableMember.
Declaration
public override int GetHashCode()
Returns
Type |
Description |
System.Int32 |
|
ToString()
Describes this SerializableMember.
This is provided for debugging purposes, and the format is not guaranteed to be stable between releases.
Declaration
public override string ToString()
Returns
Type |
Description |
System.String |
|
Operators
Equality(SerializableMember, SerializableMember)
Compare two SerializableMembers for equality
Declaration
public static bool operator ==(SerializableMember a, SerializableMember b)
Parameters
Returns
Type |
Description |
System.Boolean |
|
Inequality(SerializableMember, SerializableMember)
Compare two SerializableMembers for inequality
Declaration
public static bool operator !=(SerializableMember a, SerializableMember b)
Parameters
Returns
Type |
Description |
System.Boolean |
|
Implements
System.IEquatable<>