private static void OnMasterVolumeChanged(DependencyObject d, DependencyPropertyChangedEventArgs e) { PresetItem D = d as PresetItem; //D.volumeChangeTimer.Stop(); D.volumeChangeTimer.Start(); }
/// <summary> /// Copies this preset into specified preset object. /// </summary> public void SaveAs(PresetItem dst) { dst.Name = Name; dst.MasterVolume = MasterVolume; dst.Files.Clear(); foreach (var item in Files) { dst.Files.Add(item.Clone()); } }
private void LoadPresetButton_Click(object sender, RoutedEventArgs e) { string Result = SelectPresetWindow.InstanceLoad(this, config.Presets); PresetItem Preset = GetPresetByName(Result); if (Preset != null) { Preset.SaveAs(config.Current); config.Current.MasterVolume = -1; config.Current.MasterVolume = Preset.MasterVolume; } }
private void SavePresetButton_Click(object sender, RoutedEventArgs e) { string Result = SelectPresetWindow.InstanceSave(this, config.Presets); if (!string.IsNullOrEmpty(Result)) { PresetItem Preset = GetPresetByName(Result); if (Preset == null) { Preset = new PresetItem(); config.Presets.Add(Preset); } config.Current.SaveAs(Preset); Preset.Name = Result; config.Save(); } }