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

namespace CommonHelpers {

//**************************************************************************************************
partial class HXmlConfigurationBase {
//~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~

/// <exception cref="InvalidOperationException" />
protected internal HXmlConfigurationException CreateExceptionWithFile(string message)
{
   return new HXmlConfigurationException( ProvideErrorMessageWithFile( message ) );
}

/// <exception cref="InvalidOperationException" />
protected internal HXmlConfigurationException CreateExceptionWithFile( string messageFmt,
                                                                        params object[] parameters )
{
   return CreateExceptionWithFile( string.Format(messageFmt,parameters) );
}

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

/// <exception cref="InvalidOperationException" />
protected internal HXmlConfigurationException CreateExceptionWithPath(string message)
{
   return new HXmlConfigurationException( ProvideErrorMessageWithPath( message ) );
}

/// <exception cref="InvalidOperationException" />
protected internal HXmlConfigurationException CreateExceptionWithPath( string messageFmt,
                                                                        params object[] parameters )
{
   return CreateExceptionWithPath( string.Format(messageFmt,parameters) );
}

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

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

/// <exception cref="InvalidOperationException" />
protected internal HXmlConfigurationException CreateExceptionWithPathAndAttribute
(
   string attributeName, string messageFmt, params object[] parameters
)
{
   return CreateExceptionWithPathAndAttribute(
      attributeName, string.Format(messageFmt,parameters) );
}

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

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

/// <exception cref="InvalidOperationException" />
protected internal HXmlConfigurationException CreateExceptionWithExplicitPath
(
   string elementPath, string messageFmt, params object[] parameters
)
{
   return CreateExceptionWithExplicitPath( elementPath, string.Format(messageFmt,parameters) );
}

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

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

/// <exception cref="InvalidOperationException" />
protected internal HXmlConfigurationException CreateExceptionWithExplicitPathAndAttribute
(
   string elementPath, string attributeName, string messageFmt, params object[] parameters
)
{
   return CreateExceptionWithExplicitPathAndAttribute(
      elementPath, attributeName, string.Format(messageFmt,parameters) );
}

//~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
} // HXmlConfigurationBase
//**************************************************************************************************

} // CommonHelpers
