private void OnCSaveConfigTrigger() { Configuration config = new Configuration(); config.DefaultIpAddress = DeviceConnectionContext.IpAddress; //config.CrossFadeDuration = SwitchPropertiesContext.FadeDuration.; config.Cam1Source = SwitchPropertiesContext.Cam1Source; config.Cam2Source = SwitchPropertiesContext.Cam2Source; config.NoteBookSource = SwitchPropertiesContext.NoteBookSource; config.LogoSource = SwitchPropertiesContext.LogoSource; try { SeDeSerializer.SerializeConfig(config); _ConfigIsHealthy = true; } catch (Exception) { MessageBox.Show("Error during saving of configuration."); } }
Configuration LoadConfig() { Configuration config; try { config = SeDeSerializer.DeSerializeConfig(); _ConfigIsHealthy = true; } catch (Exception) { ExpandedConfigView = true; config = new Configuration(); config.DefaultIpAddress = "192.168.178.xx"; config.CrossFadeDuration = 2.0; config.Cam1Source = new StringObjectPair <long>("", -1); config.Cam1Source = new StringObjectPair <long>("", -1); config.NoteBookSource = new StringObjectPair <long>("", -1); config.LogoSource = new StringObjectPair <long>("", -1); } return(config); }