Exemplo n.º 1
0
        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));
        }
Exemplo n.º 2
0
        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);
            }
        }
Exemplo n.º 3
0
 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));
 }
Exemplo n.º 4
0
 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);
 }