-patch InvokeOn* to call all methods
This commit is contained in:
@@ -204,32 +204,51 @@ namespace Newtonsoft.Json.Serialization
|
|||||||
|
|
||||||
internal void InvokeOnSerializing(object o, StreamingContext context)
|
internal void InvokeOnSerializing(object o, StreamingContext context)
|
||||||
{
|
{
|
||||||
if (OnSerializing != null)
|
if (OnSerializingMethods == null) return;
|
||||||
OnSerializing.Invoke(o, new object[] {context});
|
|
||||||
|
foreach (MethodInfo mi in OnSerializingMethods)
|
||||||
|
{
|
||||||
|
mi.Invoke(o, new object[] {context});
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
internal void InvokeOnSerialized(object o, StreamingContext context)
|
internal void InvokeOnSerialized(object o, StreamingContext context)
|
||||||
{
|
{
|
||||||
if (OnSerialized != null)
|
if (OnSerializedMethods == null) return;
|
||||||
OnSerialized.Invoke(o, new object[] {context});
|
|
||||||
|
foreach (MethodInfo mi in OnSerializedMethods)
|
||||||
|
{
|
||||||
|
mi.Invoke(o, new object[] {context});
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
internal void InvokeOnDeserializing(object o, StreamingContext context)
|
internal void InvokeOnDeserializing(object o, StreamingContext context)
|
||||||
{
|
{
|
||||||
if (OnDeserializing != null)
|
if (OnDeserializingMethods == null) return;
|
||||||
OnDeserializing.Invoke(o, new object[] {context});
|
|
||||||
|
foreach (MethodInfo mi in OnDeserializingMethods)
|
||||||
|
{
|
||||||
|
mi.Invoke(o, new object[] {context});
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
internal void InvokeOnDeserialized(object o, StreamingContext context)
|
internal void InvokeOnDeserialized(object o, StreamingContext context)
|
||||||
{
|
{
|
||||||
if (OnDeserialized != null)
|
if (OnDeserializedMethods == null) return;
|
||||||
OnDeserialized.Invoke(o, new object[] {context});
|
|
||||||
|
foreach (MethodInfo mi in OnDeserializedMethods)
|
||||||
|
{
|
||||||
|
mi.Invoke(o, new object[] {context});
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
internal void InvokeOnError(object o, StreamingContext context, ErrorContext errorContext)
|
internal void InvokeOnError(object o, StreamingContext context, ErrorContext errorContext)
|
||||||
{
|
{
|
||||||
if (OnError != null)
|
if (OnErrorMethods == null) return;
|
||||||
OnError.Invoke(o, new object[] {context, errorContext});
|
foreach (MethodInfo mi in OnErrorMethods)
|
||||||
|
{
|
||||||
|
mi.Invoke(o, new object[] {context, errorContext});
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
internal JsonContract(Type underlyingType)
|
internal JsonContract(Type underlyingType)
|
||||||
|
|||||||
Reference in New Issue
Block a user