private void OnError(StreamingContext context, ErrorContext error)
      {
        this.Identifier = 25;

        // Here we could for example manually copy the
        // persisted "Id" value into the renamed "Identifier"
        // property, etc.
        error.Handled = true;

        // We never get here :(
        Console.WriteLine("Error has been fixed");
      }
 internal void OnErrorMethod(StreamingContext context, ErrorContext errorContext)
 {
   Member5 = "Error message for member " + errorContext.Member + " = " + errorContext.Error.Message;
   errorContext.Handled = true;
 }
Example #3
0
 internal void HandleError(StreamingContext context, ErrorContext errorContext)
 {
   errorContext.Handled = true;
 }
Example #4
0
 /// <summary>
 /// Initializes a new instance of the <see cref="ErrorEventArgs"/> class.
 /// </summary>
 /// <param name="currentObject">The current object.</param>
 /// <param name="errorContext">The error context.</param>
 public ErrorEventArgs(object currentObject, ErrorContext errorContext)
 {
     CurrentObject = currentObject;
     ErrorContext = errorContext;
 }
Example #5
0
 internal void InvokeOnError(object o, StreamingContext context, ErrorContext errorContext)
 {
   if (OnError != null)
     OnError.Invoke(o, new object[] {context, errorContext});
 }
 internal void OnDerivedErrorMethod(StreamingContext context, ErrorContext errorContext)
 {
 }
Example #7
0
 internal void InvokeOnError(object o, StreamingContext context, ErrorContext errorContext)
 {
     if (_onErrorCallbacks != null)
     {
         foreach (SerializationErrorCallback callback in _onErrorCallbacks)
         {
             callback(o, context, errorContext);
         }
     }
 }