0
0
mirror of https://github.com/sp-tarkov/launcher.git synced 2025-02-13 09:50:43 -05:00

50 lines
1.3 KiB
C#
Raw Normal View History

2023-03-03 19:25:33 +00:00
/* EditionCollection.cs
* License: NCSA Open Source License
*
2024-05-21 20:15:19 +01:00
* Copyright: SPT
2023-03-03 19:25:33 +00:00
* AUTHORS:
*/
2024-05-21 20:15:19 +01:00
using SPT.Launcher.Models.SPT;
2023-03-03 19:25:33 +00:00
using System.Collections.ObjectModel;
using System.ComponentModel;
using SPT.Launcher.Utilities;
2023-03-03 19:25:33 +00:00
2024-05-21 20:15:19 +01:00
namespace SPT.Launcher.Models.Launcher
2023-03-03 19:25:33 +00:00
{
public class EditionCollection : NotifyPropertyChangedBase
2023-03-03 19:25:33 +00:00
{
private bool _hasSelection;
2023-03-03 19:25:33 +00:00
public bool HasSelection
{
get => _hasSelection;
set => SetProperty(ref _hasSelection, value);
2023-03-03 19:25:33 +00:00
}
private int _selectedEditionIndex;
2023-03-03 19:25:33 +00:00
public int SelectedEditionIndex
{
get => _selectedEditionIndex;
set => SetProperty(ref _selectedEditionIndex, value);
2023-03-03 19:25:33 +00:00
}
private SPTEdition _selectedEdition;
2024-05-21 20:15:19 +01:00
public SPTEdition SelectedEdition
2023-03-03 19:25:33 +00:00
{
get => _selectedEdition;
set => SetProperty(ref _selectedEdition, value, () => HasSelection = _selectedEdition != null);
2023-03-03 19:25:33 +00:00
}
public ObservableCollection<SPTEdition> AvailableEditions { get; private set; } = [];
2023-03-03 19:25:33 +00:00
public EditionCollection()
{
SelectedEditionIndex = 0;
foreach(var edition in ServerManager.SelectedServer.editions)
{
2024-05-21 20:15:19 +01:00
AvailableEditions.Add(new SPTEdition(edition));
}
2023-03-03 19:25:33 +00:00
}
}
}