public static void LoadSettings(string fileName) { try { Debug.WriteLine("Attempting to load configuration settings from: " + fileName); _settings = (Ch3EtahSettingsHelper)XmlSerializationHelper.LoadObject(GetFullPath(fileName), typeof(Ch3EtahSettingsHelper)); } catch (Exception ex) { Debug.WriteLine("Loading configuration settings failed: '" + ex.Message + "'"); Debug.WriteLine("Attempting to load configuration settings from embeded resource."); _settings = (Ch3EtahSettingsHelper)XmlSerializationHelper.LoadObject(typeof(Ch3EtahConfig).Assembly.GetManifestResourceStream(CONFIG_RESOURCE_NAME), typeof(Ch3EtahSettingsHelper)); } Debug.WriteLine("Configuration settings loaded successfully."); }
public static void LoadSettings(string fileName) { try { _settings = (Ch3EtahSettingsHelper)XmlSerializationHelper.LoadObject(GetFullPath(fileName), typeof(Ch3EtahSettingsHelper)); } catch { _settings = (Ch3EtahSettingsHelper)XmlSerializationHelper.LoadObject(typeof(Ch3EtahConfig).Assembly.GetManifestResourceStream(CONFIG_RESOURCE_NAME), typeof(Ch3EtahSettingsHelper)); } }