Class Reset
Represents code called before a setter is called or a field
is set.
Wraps a static method, an instance method, or a delegate.
Inheritance
System.Object
Reset
Namespace: Cesil
Assembly: Cesil.dll
Syntax
public sealed class Reset : Object, IEquatable<Reset>
Methods
AllowNullRows()
Returns a Reset that differs from this by explicitly allowing
null rows be passed to it.
If the backing delegate, or method does not expect null rows
this could result in errors at runtime.
Declaration
public Reset AllowNullRows()
Returns
Equals(Reset)
Returns true if this object equals the given Reset.
Declaration
public bool Equals(Reset reset)
Parameters
Type |
Name |
Description |
Reset |
reset |
|
Returns
Type |
Description |
System.Boolean |
|
Equals(Object)
Returns true if this object equals the given Reset.
Declaration
public override bool Equals(object obj)
Parameters
Type |
Name |
Description |
System.Object |
obj |
|
Returns
Type |
Description |
System.Boolean |
|
ForbidNullRows()
Returns a Reset that differs from this by explicitly forbidding
null rows be passed to it.
If the .NET runtime cannot guarantee that nulls will not be passed,
null checks will be injected.
Declaration
public Reset ForbidNullRows()
Returns
ForDelegate(StaticResetDelegate)
Create a reset from a delegate.
Declaration
public static Reset ForDelegate(StaticResetDelegate del)
Parameters
Returns
ForDelegate<TRow>(ResetByRefDelegate<TRow>)
Create a reset from a delegate.
Declaration
public static Reset ForDelegate<TRow>(ResetByRefDelegate<TRow> del)
Parameters
Returns
Type Parameters
ForDelegate<TRow>(ResetDelegate<TRow>)
Create a reset from a delegate.
Declaration
public static Reset ForDelegate<TRow>(ResetDelegate<TRow> del)
Parameters
Returns
Type Parameters
Create a reset from a method.
The method must return void.
If method is an instance, it can take:
- zero parameters or
- a single
in ReadContext
parameter.
If a method is static, it can take:
- zero parameters or
- a single parameter of the row type or
- a single parameter of
in ReadContext
or
- two parameters, the first of the row type (which may be by ref) and the second of
in ReadContext
If the reset is instance or takes a of the row type parameter, the instance or parameter
type must be assignable from the type being deserialized.
Declaration
public static Reset ForMethod(MethodInfo method)
Parameters
Type |
Name |
Description |
System.Reflection.MethodInfo |
method |
|
Returns
GetHashCode()
Returns a stable hash for this Reset.
Declaration
public override int GetHashCode()
Returns
Type |
Description |
System.Int32 |
|
ToString()
Describes this Reset.
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(Reset, Reset)
Compare two Resets for equality
Declaration
public static bool operator ==(Reset a, Reset b)
Parameters
Returns
Type |
Description |
System.Boolean |
|
Explicit(Delegate to Reset)
Convenience operator, equivalent to calling Reset.ForDelegate if non-null.
Returns null if del is null.
Declaration
public static explicit operator Reset(Delegate del)
Parameters
Type |
Name |
Description |
System.Delegate |
del |
|
Returns
Explicit(MethodInfo to Reset)
Convenience operator, equivalent to calling Reset.ForMethod if non-null.
Returns null if method is null.
Declaration
public static explicit operator Reset(MethodInfo method)
Parameters
Type |
Name |
Description |
System.Reflection.MethodInfo |
method |
|
Returns
Inequality(Reset, Reset)
Compare two Resets for inequality
Declaration
public static bool operator !=(Reset a, Reset b)
Parameters
Returns
Type |
Description |
System.Boolean |
|
Implements
System.IEquatable<>