sort systems by name

This commit is contained in:
Florian Stinglmayr 2024-04-12 13:50:13 +02:00
parent 0f44a6a9a7
commit abb7954614

View File

@ -1,11 +1,12 @@
using System.Collections.Generic; using System;
using System.Collections.Generic;
using System.ComponentModel; using System.ComponentModel;
using System.Linq; using System.Linq;
using EDPlayerJournal.BGS; using EDPlayerJournal.BGS;
namespace EliteBGS; namespace EliteBGS;
public class SystemObjectives : INotifyPropertyChanged { public class SystemObjectives : INotifyPropertyChanged, IComparable<SystemObjectives> {
public event PropertyChangedEventHandler PropertyChanged; public event PropertyChangedEventHandler PropertyChanged;
private bool isenabled = true; private bool isenabled = true;
@ -23,6 +24,11 @@ public class SystemObjectives : INotifyPropertyChanged {
public string SystemName { get; set; } = string.Empty; public string SystemName { get; set; } = string.Empty;
public List<Objective> Objectives { get; set; } = new(); public List<Objective> Objectives { get; set; } = new();
public int CompareTo(SystemObjectives other) {
if (other == null) return 1;
return string.Compare(SystemName, other.SystemName, StringComparison.OrdinalIgnoreCase);
}
} }
public class Report { public class Report {
@ -62,5 +68,7 @@ public class Report {
} }
objective.UITransactions.Add(new UITransaction(t)); objective.UITransactions.Add(new UITransaction(t));
} }
SystemObjectives.Sort();
} }
} }