22de5679b7
Added suppoer for "Handbox" custom action Changes how the focuser in and out functions. Now sends multiple :F+/-# and multiple stop commands to help get over problems with the #909 missing commands. Added support for checking for the older firmware that does not support the guiding commands, so uses guide rate slew instead.
37 lines
1.1 KiB
C#
37 lines
1.1 KiB
C#
using System.Globalization;
|
|
using System.Threading;
|
|
using System.Resources;
|
|
using System.Reflection;
|
|
|
|
namespace ASCOM.Meade.net.Localization
|
|
{
|
|
internal class LocalisationHelper
|
|
{
|
|
private const string LocalizationNamespace = "LocalisationTest.Localization.Resources.Localization";
|
|
ResourceManager _resourceManager;
|
|
|
|
public LocalisationHelper()
|
|
{
|
|
_resourceManager = new ResourceManager(LocalizationNamespace, Assembly.GetExecutingAssembly());
|
|
|
|
SetLocalisation(CultureInfo.CurrentCulture.Name);
|
|
}
|
|
|
|
internal void SetLocalisation(string name)
|
|
{
|
|
var cultureInfo = new CultureInfo(name);
|
|
|
|
//CultureInfo.DefaultThreadCurrentCulture = cultureInfo;
|
|
//CultureInfo.DefaultThreadCurrentUICulture = cultureInfo;
|
|
|
|
Thread.CurrentThread.CurrentCulture = cultureInfo;
|
|
Thread.CurrentThread.CurrentUICulture = cultureInfo;
|
|
}
|
|
|
|
internal string GetString(string key)
|
|
{
|
|
return _resourceManager.GetString(key);
|
|
}
|
|
}
|
|
}
|