/// <summary> /// /// </summary> public ResourceLoader() { settings = new SettingsReaderWriter(); resManager = new ResourceManager("RFiDGear.Resources.Manifest", System.Reflection.Assembly.GetExecutingAssembly()); settings.ReadSettings(); cultureInfo = (settings.DefaultSpecification.DefaultLanguage == "german") ? new CultureInfo("de") : new CultureInfo("en"); }
/// <summary> /// /// </summary> /// <param name="type"></param> public EnumerateExtension(Type type) { this.Type = type; settings = new SettingsReaderWriter(); resManager = new ResourceManager("RFiDGear.Resources.Manifest", System.Reflection.Assembly.GetExecutingAssembly()); settings.ReadSettings(); cultureInfo = (new DefaultSpecification().DefaultLanguage == "german") ? new CultureInfo("de") : new CultureInfo("en"); }
/// <summary> /// /// </summary> /// <param name="resName"></param> /// <returns></returns> public static string getResource(string resName) { try { using (SettingsReaderWriter settings = new SettingsReaderWriter()) { settings.ReadSettings(); return(new ResourceManager("RFiDGear.Resources.Manifest", System.Reflection.Assembly.GetExecutingAssembly()) .GetString(resName, (settings.DefaultSpecification.DefaultLanguage == "german") ? new CultureInfo("de") : new CultureInfo("en"))); } } catch (Exception e) { LogWriter.CreateLogEntry(string.Format("{0}; {1}; {2}", DateTime.Now, e.Message, e.InnerException != null ? e.InnerException.Message : "")); return(string.Empty); } }