This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
using System.Configuration; | |
namespace JungleApp.Batch.Infraestructure | |
{ | |
//Configuration of AppCountriesSection in the app.config | |
class ConfigurationAppCountriesSection : ConfigurationSection | |
{ | |
private const string _CountriesCollectionName = "Countries"; | |
[ConfigurationProperty(_CountriesCollectionName)] |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
public ICommunicator GetCommunicator(string typeName) | |
{ | |
Type communicatorType = Type.GetType(typeName); | |
if (communicatorType == null) | |
throw new NullReferenceException(); | |
ICommunicator communicator = Activator.CreateInstance(communicatorType, new object[] { new ConnectionParameters() | |
{ | |
IP = "My IP", |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Thread.CurrentThread.CurrentCulture = new CultureInfo("es-ES"); | |
string valueToConvert = "24/12/2020 23:50"; | |
Console.WriteLine($"(1) Change Current Culture to { Thread.CurrentThread.CurrentCulture.Name }"); | |
Console.WriteLine($"(1) Try to convert { valueToConvert } using { Thread.CurrentThread.CurrentCulture.Name } culture - Default Culture Format [dd/MM/yyyy]..."); | |
var parseValue = Convert.ToDateTime(valueToConvert); | |
Console.WriteLine("-->Success!"); | |
Thread.CurrentThread.CurrentCulture = new CultureInfo("en-US"); | |
try |