private void LoadProfile(AutoclickerProfile profile) { LMBMinCpsTextBox.Text = profile.lmbMinCps.ToString(); RMBMaxCpsTextBox.Text = profile.rmbMaxCps.ToString(); LMBMaxCpsTextBox.Text = profile.lmbMaxCps.ToString(); RMBMaxCpsTextBox.Text = profile.rmbMaxCps.ToString(); LMBRampupDuration.Text = profile.lmbRampupDuration.ToString(); RMBRampupDuration.Text = profile.rmbRampupDuration.ToString(); LMBRampupInitial.Text = profile.lmbRampupInitial.ToString(); RMBRampupInitial.Text = profile.rmbRampupInitial.ToString(); BothSidesCanBeActive.IsChecked = profile.canBothBeActive; ClicksDisablesOtherSide.IsChecked = profile.clicksDisablesOtherSide; NumberDisablesAutoclicker.IsChecked = profile.numbersDisablesAutoclicker; PlayToggleSounds.IsChecked = profile.playToggleSounds; PlayClickSounds.IsChecked = profile.playClickSounds; LMBBiasTextBox.Text = profile.lmbBias.ToString(); RMBBiasTextBox.Text = profile.rmbBias.ToString(); LMBMiniDeviationTextBox.Text = profile.lmbMiniDeviation.ToString(); RMBMiniDeviationTextBox.Text = profile.rmbMiniDeviation.ToString(); }
private string ExportCurrentProfile() { AutoclickerProfile profile = new AutoclickerProfile(); profile.lmbMinCps = lmbMinCps; profile.rmbMinCps = rmbMinCps; profile.lmbMaxCps = lmbMaxCps; profile.rmbMaxCps = rmbMaxCps; profile.lmbRampupDuration = lmbRampupDuration; profile.rmbRampupDuration = rmbRampupDuration; profile.lmbRampupInitial = lmbRampupInitial; profile.rmbRampupInitial = rmbRampupInitial; profile.canBothBeActive = canBothBeActive; profile.clicksDisablesOtherSide = clicksDisablesOtherSide; profile.numbersDisablesAutoclicker = numbersDisablesAutoclicker; profile.playToggleSounds = playToggleSounds; profile.playClickSounds = playClickSounds; profile.lmbBias = lmbBias; profile.rmbBias = rmbBias; profile.lmbMiniDeviation = lmbMiniDeviation; profile.rmbMiniDeviation = rmbMiniDeviation; return ExportProfile(profile); }
private void ImportProfile(string raw) { try { AutoclickerProfile profile = JsonConvert.DeserializeObject<AutoclickerProfile>(raw); LoadProfile(profile); } catch (Exception e) { System.Windows.MessageBox.Show($"Error: {e.Message}"); } }
private string ExportProfile(AutoclickerProfile profile) { try { string raw = JsonConvert.SerializeObject(profile); return raw; } catch (Exception e) { System.Windows.MessageBox.Show($"Error: {e.Message}"); return string.Empty; } }