public UISettingsViewModel(PeerCastStation.Core.PecaSettings settings) { this.settings = settings; var wpf = settings.Get <WPFSettings>(); var ui = settings.Get <UISettings>(); if (ui.BroadcastHistory.Length > 0) { BroadcastHistory = new ObservableCollection <BroadcastInfoViewModel>( ui.BroadcastHistory.Select(info => new BroadcastInfoViewModel(info))); } else { BroadcastHistory = new ObservableCollection <BroadcastInfoViewModel>( wpf.BroadcastHistory.Select(info => new BroadcastInfoViewModel(info))); } if (ui.DefaultPlayProtocols.TryGetValue("FLV", out var protocol)) { FLVPlayProtocol = protocol; } else { FLVPlayProtocol = PlayProtocol.Unknown; } }
public void Save() { var wpf = settings.Get <WPFSettings>(); var ui = settings.Get <PeerCastStation.UI.UISettings>(); ui.BroadcastHistory = BroadcastHistory.Select(info => info.Save()).ToArray(); wpf.BroadcastHistory = new BroadcastInfo[0]; PeerCastStation.Core.PeerCastApplication.Current.SaveSettings(); }
public void Save() { var wpf = settings.Get <WPFSettings>(); var ui = settings.Get <UISettings>(); ui.BroadcastHistory = BroadcastHistory.Select(info => info.Save()).ToArray(); ui.DefaultPlayProtocols["FLV"] = FLVPlayProtocol; wpf.BroadcastHistory = new BroadcastInfo[0]; PeerCastStation.Core.PeerCastApplication.Current.SaveSettings(); }
public UISettingsViewModel(PeerCastStation.Core.PecaSettings settings) { this.settings = settings; var wpf = settings.Get <WPFSettings>(); var ui = settings.Get <PeerCastStation.UI.UISettings>(); if (ui.BroadcastHistory.Length > 0) { BroadcastHistory = new ObservableCollection <BroadcastInfoViewModel>( ui.BroadcastHistory.Select(info => new BroadcastInfoViewModel(info))); } else { BroadcastHistory = new ObservableCollection <BroadcastInfoViewModel>( wpf.BroadcastHistory.Select(info => new BroadcastInfoViewModel(info))); } }