//\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\
//
// UserWin satellite library | Author: Sergei Y.Kitáev
//
//~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
using System;
using System.Threading.Tasks;

using System.Windows;

using CommonHelpers;

namespace UserWin {

//**************************************************************************************************
partial class UXAppWaiting {
//~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~

public static async Task<bool> ReportErrorWithData( [HOptional] object data, string errorMessage )
{
   return await ReportErrorWithData( data, null, errorMessage, false );
}

public static async Task<bool> ReportErrorWithData( [HOptional] object data, Exception e )
{
   return await ReportErrorWithData( data, null, e );
}

//--------------------------------------------------------------------------------------------------

public static async Task<bool> ReportErrorWithData(
   [HOptional] object data, string errorMessage, bool skipSuppressBackOff )
{
   return await ReportErrorWithData( data, null, errorMessage, skipSuppressBackOff );
}

public static async Task<bool> ReportErrorWithData(
   [HOptional] object data, Exception e, bool skipSuppressBackOff )
{
   return await ReportErrorWithData( data, null, e, skipSuppressBackOff );
}

//==================================================================================================

public static async Task<bool> ReportErrorWithData(
   [HOptional] object data, [HOptional] Window owner, string errorMessage )
{
   return await ReportErrorWithData( data, owner, errorMessage, false );
}

public static async Task<bool> ReportErrorWithData(
   [HOptional] object data, [HOptional] Window owner, Exception e )
{
   return await ReportErrorWithData( data, owner, e, false );
}

//--------------------------------------------------------------------------------------------------

public static async Task<bool> ReportErrorWithData(
   [HOptional] object data, [HOptional] Window owner,
   string errorMessage, bool skipSuppressBackOff )
{
   return await ReportError( CreateShowMessageExtraInfo( data ),
      owner, errorMessage, skipSuppressBackOff );
}

public static async Task<bool> ReportErrorWithData(
   [HOptional] object data, [HOptional] Window owner,
   Exception e, bool skipSuppressBackOff )
{
   return await ReportError( CreateShowMessageExtraInfo( data ), owner, e, skipSuppressBackOff );
}

//==================================================================================================

static UXShowMessageExtraInfo CreateShowMessageExtraInfo(object data)
{
   return new UXShowMessageExtraInfo( data, HSounds.Error );
}

//~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
} // UXAppWaiting
//**************************************************************************************************

} // UserWin
