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

#if !WASM
namespace user_rtx { using u = user_rtx;
#else
namespace user_rtx.wasm { using u = user_rtx.wasm;
#endif

partial class XmlConfigurationBase {
//~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~

/// <exception cref="InvalidOperationException" />
protected internal EXmlConfiguration CreateExceptionWithFile( string message ) =>
   new EXmlConfiguration( ProvideErrorMessageWithFile( message ) );

/// <exception cref="InvalidOperationException" />
protected internal EXmlConfiguration CreateExceptionWithFile( string messageFmt,
                                                              params object?[] args ) =>
   CreateExceptionWithFile( string.Format( messageFmt, args ) );

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

/// <exception cref="InvalidOperationException" />
protected internal EXmlConfiguration CreateExceptionWithPath( string message ) =>
   new EXmlConfiguration( ProvideErrorMessageWithPath( message ) );

/// <exception cref="InvalidOperationException" />
protected internal EXmlConfiguration CreateExceptionWithPath( string messageFmt,
                                                              params object?[] args ) =>
   CreateExceptionWithPath( string.Format(messageFmt,args) );

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

/// <exception cref="InvalidOperationException" />
protected internal EXmlConfiguration CreateExceptionWithPathAndAttribute( string attributeName,
                                                                          string message ) =>
   new EXmlConfiguration(
      ProvideErrorMessageWithPathAndAttribute( attributeName, message ) );

/// <exception cref="InvalidOperationException" />
protected internal EXmlConfiguration CreateExceptionWithPathAndAttribute( string attributeName,
                                                                          string messageFmt,
                                                                          params object?[] args ) =>
   CreateExceptionWithPathAndAttribute(
      attributeName, string.Format(messageFmt,args) );

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

/// <exception cref="InvalidOperationException" />
protected internal EXmlConfiguration CreateExceptionWithExplicitPath( string elementPath,
                                                                      string message ) =>
   new EXmlConfiguration(
      ProvideErrorMessageWithExplicitPath( elementPath, message ) );

/// <exception cref="InvalidOperationException" />
protected internal EXmlConfiguration CreateExceptionWithExplicitPath( string elementPath,
                                                                      string messageFmt,
                                                                      params object?[] args ) =>
   CreateExceptionWithExplicitPath( elementPath, string.Format(messageFmt,args) );

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

/// <exception cref="InvalidOperationException" />
protected internal EXmlConfiguration CreateExceptionWithExplicitPathAndAttribute(
   string elementPath, string attributeName, string message )
=>
   new EXmlConfiguration(
   ProvideErrorMessageWithExplicitPathAndAttribute( elementPath, attributeName, message ) );

/// <exception cref="InvalidOperationException" />
protected internal EXmlConfiguration CreateExceptionWithExplicitPathAndAttribute(
   string elementPath, string attributeName, string messageFmt, params object?[] args )
=>
   CreateExceptionWithExplicitPathAndAttribute(
      elementPath, attributeName, string.Format( messageFmt, args ) );

//~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
} // XmlConfigurationBase

} // user_rtx (.wasm)
