protected virtual Task OnError(object sender, ComponentErrorEventArgs e) { Logger.Write(this, LogLevel.Error, e.Message); if (this.Error == null) { #if NET40 return(TaskEx.FromResult(false)); #else return(Task.CompletedTask); #endif } return(this.Error(sender, e)); }
protected virtual async Task OnError(object sender, ComponentErrorEventArgs e) { var component = sender as IBaseComponent; if (e.Exception is AggregateException) { foreach (var innerException in (e.Exception as AggregateException).InnerExceptions) { await this.Add(new ComponentError(component, e.Message, innerException)).ConfigureAwait(false); } } else { await this.Add(new ComponentError(component, e.Message, e.Exception)).ConfigureAwait(false); } }
protected virtual Task OnPipelineManagerError(object sender, ComponentErrorEventArgs e) { //This usually means that the device buffer was lost. //Nothing can be done. return(this.ShutdownCore(true)); }
protected virtual Task OnComponentError(object sender, ComponentErrorEventArgs e) { return(this.OnError(e.Message, e.Exception)); }
/// <summary> /// Raises the <see cref="ComponentError" /> event. /// </summary> /// <param name="e">The <see cref="Microsoft.Win32.TaskScheduler.TaskPropertiesControl.ComponentErrorEventArgs" /> instance containing the event data.</param> protected virtual void OnComponentError(ComponentErrorEventArgs e) { EventHandler<ComponentErrorEventArgs> handler = ComponentError; if (handler != null) handler(this, e); }