46 lines
1.3 KiB
C#
46 lines
1.3 KiB
C#
using System.Linq;
|
|
using JD.Guinness.WPF.Module.Configuration.XBoxOne;
|
|
using JD.Guinness.WPF.Module.Extension;
|
|
using Plume.WPF.Mvvm;
|
|
|
|
namespace JD.Guinness.WPF.Module.Model.XBoxOne
|
|
{
|
|
public sealed class XBoxOneConfiguration : BindableBase, IWarnable
|
|
{
|
|
private bool _generate;
|
|
private string _settingsFilePath;
|
|
private string _warnings;
|
|
|
|
public bool Generate
|
|
{
|
|
get => _generate;
|
|
set => SetProperty(ref _generate, value);
|
|
}
|
|
|
|
public string SettingsFilePath
|
|
{
|
|
get => _settingsFilePath;
|
|
set => SetProperty(ref _settingsFilePath, value);
|
|
}
|
|
|
|
public string Warnings
|
|
{
|
|
get => _warnings;
|
|
set => SetProperty(ref _warnings, value);
|
|
}
|
|
|
|
public DispatcherObservableCollection<Selectable<LanguageInfo>> Languages { get; }
|
|
|
|
public XBoxOneConfiguration()
|
|
{
|
|
Languages = new DispatcherObservableCollection<Selectable<LanguageInfo>>();
|
|
}
|
|
|
|
public XBoxOneConfigurationSave ToSave(string workspacePath) => new XBoxOneConfigurationSave
|
|
{
|
|
Generate = Generate,
|
|
SettingsFilePath = SettingsFilePath.ToRelativePath(workspacePath),
|
|
Languages = Languages.Where(s => s.IsSelected).Select(s => s.Value.Id).ToArray()
|
|
};
|
|
}
|
|
}
|