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

using WF = System.Windows.Forms;

using CommonHelpers;

namespace WFX {

//**************************************************************************************************
partial class MessageBox {
//~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~

public static void ShowError([HOptional] ShowMessageExtraInfo extraInfo,string text)
{
   ShowError(extraInfo,(WF.IWin32Window)null,text);
}

public static WF.DialogResult ShowError( [HOptional] ShowMessageExtraInfo extraInfo,
                                         string text, WF.MessageBoxButtons buttons )
{
   return ShowError(extraInfo,(WF.IWin32Window)null,text,buttons);
}

public static WF.DialogResult ShowError( [HOptional] ShowMessageExtraInfo extraInfo,
                                         string text, WF.MessageBoxButtons buttons,
                                         WF.DialogResult defaultResult )
{
   return ShowError(extraInfo,(WF.IWin32Window)null,text,buttons,defaultResult);
}

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

public static void ShowError( [HOptional] ShowMessageExtraInfo extraInfo,
                              string text, [HOptional] string caption )
{
   ShowError(extraInfo,(WF.IWin32Window)null,text,caption);
}

public static WF.DialogResult ShowError( [HOptional] ShowMessageExtraInfo extraInfo,
                                         string text, [HOptional] string caption,
                                         WF.MessageBoxButtons buttons )
{
   return ShowError(extraInfo,(WF.IWin32Window)null,text,caption,buttons);
}

public static WF.DialogResult ShowError( [HOptional] ShowMessageExtraInfo extraInfo,
                                         string text, [HOptional] string caption,
                                         WF.MessageBoxButtons buttons,
                                         WF.DialogResult defaultResult )
{
   return ShowError(extraInfo,(WF.IWin32Window)null,text,caption,buttons,defaultResult);
}

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

public static void ShowError([HOptional] ShowMessageExtraInfo extraInfo,Exception e)
{
   ShowError(extraInfo,(WF.IWin32Window)null,e);
}

public static WF.DialogResult ShowError( [HOptional] ShowMessageExtraInfo extraInfo,
                                         Exception e, WF.MessageBoxButtons buttons )
{
   return ShowError(extraInfo,(WF.IWin32Window)null,e,buttons);
}

public static WF.DialogResult ShowError( [HOptional] ShowMessageExtraInfo extraInfo,
                                         Exception e,
                                         WF.MessageBoxButtons buttons,
                                         WF.DialogResult defaultResult )
{
   return ShowError(extraInfo,(WF.IWin32Window)null,e,buttons,defaultResult);
}

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

public static void ShowError( [HOptional] ShowMessageExtraInfo extraInfo,
                              Exception e, [HOptional] string caption )
{
   ShowError(extraInfo,(WF.IWin32Window)null,e,caption);
}

public static WF.DialogResult ShowError( [HOptional] ShowMessageExtraInfo extraInfo,
                                         Exception e, [HOptional] string caption,
                                         WF.MessageBoxButtons buttons )
{
   return ShowError(extraInfo,(WF.IWin32Window)null,e,caption,buttons);
}

public static WF.DialogResult ShowError( [HOptional] ShowMessageExtraInfo extraInfo,
                                         Exception e, [HOptional] string caption,
                                         WF.MessageBoxButtons buttons,
                                         WF.DialogResult defaultResult )
{
   return ShowError(extraInfo,(WF.IWin32Window)null,e,caption,buttons,defaultResult);
}

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

public static void ShowError( [HOptional] ShowMessageExtraInfo extraInfo,
                              [HOptional] WF.IWin32Window owner, string text )
{
   ShowError(extraInfo,owner,text,null);
}

public static WF.DialogResult ShowError( [HOptional] ShowMessageExtraInfo extraInfo,
                                         WF.IWin32Window owner,
                                         string text, WF.MessageBoxButtons buttons )
{
   return ShowError(extraInfo,owner,text,null,buttons);
}

public static WF.DialogResult ShowError( [HOptional] ShowMessageExtraInfo extraInfo,
                                         WF.IWin32Window owner,
                                         string text, WF.MessageBoxButtons buttons,
                                         WF.DialogResult defaultResult )
{
   return ShowError(extraInfo,owner,text,null,buttons,defaultResult);
}

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

public static void ShowError( [HOptional] ShowMessageExtraInfo extraInfo,
                              [HOptional] WF.IWin32Window owner,
                              string text, [HOptional] string caption )
{
   ShowError(extraInfo,owner,text,caption,WF.MessageBoxButtons.OK);
}

public static WF.DialogResult ShowError( [HOptional] ShowMessageExtraInfo extraInfo,
                                         [HOptional] WF.IWin32Window owner,
                                         string text, [HOptional] string caption,
                                         WF.MessageBoxButtons buttons )
{
   return ShowError(
      extraInfo, owner, text, caption, buttons,
      DefaultResultFromButtons(buttons) );
}

public static WF.DialogResult ShowError( [HOptional] ShowMessageExtraInfo extraInfo,
                                         [HOptional] WF.IWin32Window owner,
                                         string text, [HOptional] string caption,
                                         WF.MessageBoxButtons buttons,
                                         WF.DialogResult defaultResult )
{
   return ShowMessage(
      extraInfo ?? new ShowMessageExtraInfo( HSounds.Error ),
      owner, text, caption ?? ErrorCaption,
      buttons, WF.MessageBoxIcon.Error,
      defaultResult );
}

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

public static void ShowError( [HOptional] ShowMessageExtraInfo extraInfo,
                              [HOptional] WF.IWin32Window owner, Exception e )
{
   ShowError(extraInfo,owner,e,null);
}

public static WF.DialogResult ShowError( [HOptional] ShowMessageExtraInfo extraInfo,
                                         [HOptional] WF.IWin32Window owner, Exception e,
                                         WF.MessageBoxButtons buttons )
{
   return ShowError(extraInfo,owner,e,null,buttons);
}

public static WF.DialogResult ShowError( [HOptional] ShowMessageExtraInfo extraInfo,
                                         [HOptional] WF.IWin32Window owner,
                                         Exception e, WF.MessageBoxButtons buttons,
                                         WF.DialogResult defaultResult )
{
   return ShowError(extraInfo,owner,e,null,buttons,defaultResult);
}

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

public static void ShowError( [HOptional] ShowMessageExtraInfo extraInfo,
                              [HOptional] WF.IWin32Window owner,
                              Exception e, [HOptional] string caption )
{
   ShowError(extraInfo,owner,HException.GetErrorMessage(e),caption);
}

public static WF.DialogResult ShowError( [HOptional] ShowMessageExtraInfo extraInfo,
                                         [HOptional] WF.IWin32Window owner, Exception e,
                                         [HOptional] string caption,
                                         WF.MessageBoxButtons buttons )
{
   return ShowError(extraInfo,owner,HException.GetErrorMessage(e),caption,buttons);
}

public static WF.DialogResult ShowError( [HOptional] ShowMessageExtraInfo extraInfo,
                                         [HOptional] WF.IWin32Window owner, Exception e,
                                         [HOptional] string caption,
                                         WF.MessageBoxButtons buttons,
                                         WF.DialogResult defaultResult )
{
   HArgChecking.VerifyNotNull( e );
   return ShowError(
      ShowMessageExtraInfo.ProvideWithException( extraInfo, e ),
      owner, HException.GetErrorMessage(e), caption, buttons, defaultResult );
}

//~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
} // MessageBox
//**************************************************************************************************

} // WFX
