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; }
internal void HandleError(StreamingContext context, ErrorContext errorContext) { errorContext.Handled = true; }
/// <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; }
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) { }
internal void InvokeOnError(object o, StreamingContext context, ErrorContext errorContext) { if (_onErrorCallbacks != null) { foreach (SerializationErrorCallback callback in _onErrorCallbacks) { callback(o, context, errorContext); } } }