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

using WF = System.Windows.Forms;

using CommonHelpers;

namespace WFX {

//**************************************************************************************************
partial class AppWaiting {
//~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~

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

public static bool ReportErrorWithData([HOptional] object data,Exception e)
{
   return ReportErrorWithData( data, null, e );
}

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

static bool ReportErrorWithData( [HOptional] object data,
                                 string errorMessage,
                                 bool skipSuppressBackOff )
{
   return ReportErrorWithData( data, null, errorMessage, skipSuppressBackOff );
}

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

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

public static bool ReportErrorWithData( [HOptional] object data,
                                        [HOptional] WF.IWin32Window owner,
                                        string errorMessage )
{
   return ReportErrorWithData( data, owner, errorMessage, false );
}

public static bool ReportErrorWithData( [HOptional] object data,
                                        [HOptional] WF.IWin32Window owner,
                                        Exception e )
{
   return ReportErrorWithData( data, owner, e, false );
}

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

static bool ReportErrorWithData( [HOptional] object data, [HOptional] WF.IWin32Window owner,
                                 string errorMessage, bool skipSuppressBackOff )
{
   return ReportError( CreateShowMessageExtraInfo( data ),
      owner, errorMessage, skipSuppressBackOff );
}

public static bool ReportErrorWithData( [HOptional] object data, [HOptional] WF.IWin32Window owner,
                                        Exception e, bool skipSuppressBackOff )
{
   return ReportError( CreateShowMessageExtraInfo( data ), owner, e, skipSuppressBackOff );
}

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

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

//~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
} // AppWaiting
//**************************************************************************************************

} // WFX
