public void WriteData(PulseSetting obj) { _config.AppSettings.Settings[ConfigurationKey.MACHINE_ID].Value = obj.MachineId; _config.AppSettings.Settings[ConfigurationKey.MACHINE_NAME].Value = obj.MachineName; _config.AppSettings.Settings[ConfigurationKey.SERVER_URI].Value = obj.ServerUri; _config.AppSettings.Settings[ConfigurationKey.WEBAPI_URI].Value = obj.WebApiUri; _config.AppSettings.Settings[ConfigurationKey.COUNTRY].Value = obj.CountryName; _config.AppSettings.Settings[ConfigurationKey.GROUP_NAME].Value = obj.GroupName; _config.Save(ConfigurationSaveMode.Modified); }
public void SetData(PulseSetting pulseSetting) { oscAddressField.text = pulseSetting.OscAddress; oscDataField.text = pulseSetting.OscData; overrideIpField.text = pulseSetting.OverrideIP; timecodeHourInputField.text = pulseSetting.Timecode.hour.ToString(); timecodeMinuteInputField.text = pulseSetting.Timecode.minute.ToString(); timecodeSecondInputField.text = pulseSetting.Timecode.second.ToString(); timecodeFrameInputField.text = pulseSetting.Timecode.frame.ToString(); }
private PulseSetting GetOwinConfiguration() { var settings = _config.GetSection("appSettings") as AppSettingsSection; var obj = new PulseSetting { ServerUri = settings.Settings[ConfigurationKey.SERVER_URI].Value, WebApiUri = settings.Settings[ConfigurationKey.WEBAPI_URI].Value, MachineId = settings.Settings[ConfigurationKey.MACHINE_ID].Value, MachineName = settings.Settings[ConfigurationKey.MACHINE_NAME].Value, CountryName = settings.Settings[ConfigurationKey.COUNTRY].Value, GroupName = settings.Settings[ConfigurationKey.GROUP_NAME].Value, }; return(obj); }
public static PulseSetting Load(int index) { var pulseSetting = new PulseSetting( index, PlayerPrefs.GetString($"OscAddress_{index}"), PlayerPrefs.GetString($"OscData_{index}"), PlayerPrefs.GetString($"OverrideIP_{index}"), new Timecode { dropFrame = false, hour = PlayerPrefs.GetInt($"Hour_{index}"), minute = PlayerPrefs.GetInt($"Minute_{index}"), second = PlayerPrefs.GetInt($"Second_{index}"), frame = PlayerPrefs.GetInt($"Frame_{index}") } ); return(pulseSetting); }
public void Save(int index) { pulseSetting = new PulseSetting( index, _pulseSettingView.oscAddressField.text, _pulseSettingView.oscDataField.text, _pulseSettingView.overrideIpField.text, new Timecode { dropFrame = false, frame = int.Parse(_pulseSettingView.timecodeFrameInputField.text), hour = int.Parse(_pulseSettingView.timecodeHourInputField.text), minute = int.Parse(_pulseSettingView.timecodeMinuteInputField.text), second = int.Parse(_pulseSettingView.timecodeSecondInputField.text), } ); pulseSetting.Save(); _pulseSettingView.SetSaved(); }
public void Load(int index) { pulseSetting = PulseSetting.Load(index); _pulseSettingView.SetData(pulseSetting); }