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

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

//**************************************************************************************************
partial class CommonHelpersLibrary {
//~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~

public static Assembly GetOrLoadCommonHelpersAssembly()
{
   return HAssembly.GetOrLoadAssembly( "CommonHelpers",
      "CommonHelpers, Version={0}, Culture=neutral, PublicKeyToken={1}",
      CommonHelpers_Info.VersionString, CommonHelpers_Info.PublicKeyToken );
}
public static Assembly GetOrLoadCommonHelpersAssembly_2()
{
   return HAssembly.GetOrLoadAssembly( "CommonHelpers.2",
      "CommonHelpers.2, Version={0}, Culture=neutral, PublicKeyToken={1}",
      VersionString_CommonHelpers_2, CommonHelpers_Info.PublicKeyToken );
}
public static Assembly GetOrLoadCommonHelpersAssembly_3()
{
   return HAssembly.GetOrLoadAssembly( "CommonHelpers.3",
      "CommonHelpers.3, Version={0}, Culture=neutral, PublicKeyToken={1}",
      VersionString_CommonHelpers_3, CommonHelpers_Info.PublicKeyToken );
}

public static Assembly GetOrLoadCommonHelpersAssembly_Sys()
{
   return HAssembly.GetOrLoadAssembly( "CommonHelpers.Sys",
      "CommonHelpers.Sys, Version={0}, Culture=neutral, PublicKeyToken={1}",
      VersionString_CommonHelpers_Sys, CommonHelpers_Info.PublicKeyToken );
}
public static Assembly GetOrLoadCommonHelpersAssembly_CPP()
{
   return HAssembly.GetOrLoadAssembly( "CommonHelpers.CPP",
      "CommonHelpers.CPP, Version={0}, Culture=neutral, PublicKeyToken={1}",
      VersionString_CommonHelpers_CPP, CommonHelpers_Info.PublicKeyToken );
}

public static Assembly GetOrLoadUserWinAssembly()
{
   return HAssembly.GetOrLoadAssembly( "UserWin",
      "UserWin, Version={0}, Culture=neutral, PublicKeyToken={1}",
      VersionString_UserWin, CommonHelpers_Info.PublicKeyToken );
}
public static Assembly GetOrLoadWFXAssembly()
{
   return HAssembly.GetOrLoadAssembly( "WFX",
      "WFX, Version={0}, Culture=neutral, PublicKeyToken={1}",
      VersionString_WFX, CommonHelpers_Info.PublicKeyToken );
}

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

static Assembly GetOrLoadAssembly_HConsole()
{
   return GetOrLoadAssemblyByNo( CommonHelpersAssemblyNo_Plus );
}
static Assembly GetOrLoadAssembly_HSound()
{
   return GetOrLoadAssemblyByNo( CommonHelpersAssemblyNo_Plus );
}
static Assembly GetOrLoadAssembly_HBeeper()
{
   return GetOrLoadAssemblyByNo( CommonHelpersAssemblyNo_Plus );
}

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

/// <exception cref="ArgumentException" />
static Assembly GetOrLoadAssemblyByNo(int assemblyNo)
{
   switch ( assemblyNo )
   {
   case 1: return Assembly.GetExecutingAssembly();
   case 2: return GetOrLoadCommonHelpersAssembly_2();
   case 3: return GetOrLoadCommonHelpersAssembly_3();
   default: throw new ArgumentException( "Incorrect CommonHelpers assembly no." );
   }
}

//~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
} // CommonHelpersLibrary
//**************************************************************************************************

} // CommonHelpers (.WASM)
