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

#if !WASM
namespace CommonHelpers {
#else
namespace CommonHelpers.WASM {
#endif

//**************************************************************************************************
/// <summary>
/// </summary>
public static partial class HInvOpExceptionCreator {
//~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~

public static InvalidOperationException EmptyCollection =>
   new InvalidOperationException( "Collection is empty." );
public static InvalidOperationException InvalidStaticOperation =>
   new InvalidOperationException( "Invalid static operation." );

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

/// <exception cref="ArgumentNullException" />
public static InvalidOperationException PropertyWasNotSpecified(string name)
{
   HArgChecking.VerifyNotNull( name );
   return Create(
      "Property was not specified: \"{0}\".",
      name );
}

/// <exception cref="ArgumentNullException" />
public static InvalidOperationException ObjectMustBeDisposedSynchronously(object obj)
{
   HArgChecking.VerifyNotNull( obj );
   return Create(
      "Object of type \"{0}\" must be disposed synchronously.",
      obj.GetType() );
}

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

/// <exception cref="ArgumentNullException" />
public static InvalidOperationException Create(string messageFmt,params object[] parameters)
{
   HArgChecking.VerifyNotNulls( messageFmt, parameters );
   return new InvalidOperationException(HString.FormatAsText( messageFmt, parameters ));
}

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

static HInvOpExceptionCreator()
{
   CommonHelpers_Core.Access();
}

//~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
} // HInvOpExceptionCreator
//**************************************************************************************************

} // CommonHelpers (.WASM)
