Example #1
0
 public virtual void Load()
 {
     lock (readWriteLock)
     {
         TextReader textReader = null;
         try{
             XmlSerializer deserializer = XmlHelper.CreateSerializer(typeof(EV3FirmwareSettings));
             textReader = new StreamReader(settingsFileName);
             Object obj          = deserializer.Deserialize(textReader);
             var    loadSettings = (EV3FirmwareSettings)obj;
             textReader.Close();
             GeneralSettings   = loadSettings.GeneralSettings;
             WiFiSettings      = loadSettings.WiFiSettings;
             SoundSettings     = loadSettings.SoundSettings;
             WebServerSettings = loadSettings.WebServerSettings;
         }
         catch
         {
             Save();
         }
         if (textReader != null)
         {
             textReader.Close();
         }
     }
 }
Example #2
0
 public FirmwareSettings()
 {
     GeneralSettings   = new GeneralSettings();
     WiFiSettings      = new WiFiSettings();
     DebugSettings     = new DebugSettings();
     SoundSettings     = new SoundSettings();
     WebServerSettings = new WebServerSettings();
 }
Example #3
0
 public FirmwareSettings()
 {
     GeneralSettings = new GeneralSettings();
     WiFiSettings = new WiFiSettings();
     DebugSettings = new DebugSettings();
     SoundSettings = new SoundSettings();
     WebServerSettings = new WebServerSettings();
 }
Example #4
0
 public EV3FirmwareSettings(string settingsFileName)
 {
     this.settingsFileName = settingsFileName;
     GeneralSettings       = new GeneralSettings();
     WiFiSettings          = new WiFiSettings();
     SoundSettings         = new SoundSettings();
     WebServerSettings     = new WebServerSettings();
 }
		public EV3FirmwareSettings(string settingsFileName)
		{
			this.settingsFileName = settingsFileName;
			GeneralSettings = new GeneralSettings();
			WiFiSettings = new WiFiSettings();
			SoundSettings = new SoundSettings();
			WebServerSettings = new WebServerSettings();

		}
		public virtual void Load()
		{
			lock (readWriteLock) 
			{
				TextReader textReader = null;
				try{
					XmlSerializer deserializer = XmlHelper.CreateSerializer(typeof(EV3FirmwareSettings));
					textReader = new StreamReader (settingsFileName);
					Object obj = deserializer.Deserialize (textReader);
					var loadSettings = (EV3FirmwareSettings)obj;
					textReader.Close ();
					GeneralSettings = loadSettings.GeneralSettings;
					WiFiSettings = loadSettings.WiFiSettings;
					SoundSettings = loadSettings.SoundSettings;
					WebServerSettings = loadSettings.WebServerSettings;
				}
				catch
				{
					Save();
				}
				if(textReader!= null)
					textReader.Close();
			}
		}