private void ResetSettings(AppVisualSettings src, AppVisualSettings target) { target.BackgroundUrl = src.BackgroundUrl; for (int i = 0; i < src.AppBrushes.Count; i++) target.AppBrushes[i].BrushColor = src.AppBrushes[i].BrushColor; }
private void CopySettings(AppVisualSettings src, AppVisualSettings target) { target.BackgroundUrl = src.BackgroundUrl; target.AppBrushes.Clear(); foreach (var b in src.AppBrushes) target.AppBrushes.Add(new AppBrush(b.Name, b.BrushColor)); }
public AppVisualSettings Copy() { var vis = new AppVisualSettings(); vis.BackgroundUrl = BackgroundUrl; foreach (var b in AppBrushes) { vis.AppBrushes.Add(new AppBrush(b.Name, b.BrushColor)); } return vis; }
public void SaveSettings(AppVisualSettings vis) { Settings.Default.CustomBackgroundUrl = vis.BackgroundUrl; Settings.Default.AppBrushes.Clear(); foreach (var b in vis.AppBrushes) { Settings.Default.AppBrushes.Add(String.Format("{0};{1}", b.Name, b.BrushColor)); } Settings.Default.Save(); }
private void SettingsDialog() { var vis = new AppVisualSettings(); vis.GetBrushes(); vis.BackgroundUrl = CustomBackgroundUrl; if (String.IsNullOrEmpty(vis.BackgroundUrl)) vis.BackgroundUrl = BackgroundUrl; vis.PropertyChanged += (s, e) => { if (e.PropertyName == "BackgroundUrl") { CustomBackgroundUrl = vis.BackgroundUrl; } }; var sw = new SettingsWindow(); sw.DataContext = vis; sw.ShowDialog(); }
private void SettingsWindowLoaded(object sender, RoutedEventArgs e) { _memo = CurrentSettings.Copy(); }
private void LoadVisuals() { AppVisualSettings.DefaultVisualSettings.GetBrushes(); if (Settings.Default.AppBrushes == null) return; var vis = new AppVisualSettings(); foreach (var str in Settings.Default.AppBrushes) { var a = str.Split(';'); vis.AppBrushes.Add(new AppBrush(a[0], (Color)ColorConverter.ConvertFromString(a[1]))); } vis.ResetBrushes(); }