sort known encryption schemes list.

This commit is contained in:
morkt 2014-08-03 10:48:08 +04:00
parent ad9fc13068
commit 15a81fab18
2 changed files with 4 additions and 2 deletions

View File

@ -5,6 +5,5 @@
xmlns:p="clr-namespace:GameRes.Formats.Properties" xmlns:p="clr-namespace:GameRes.Formats.Properties"
MaxWidth="250"> MaxWidth="250">
<ComboBox Name="Scheme" Width="180" <ComboBox Name="Scheme" Width="180"
ItemsSource="{Binding Source={x:Static fmt:NpaOpener.KnownSchemes}, Mode=OneWay}" ItemsSource="{Binding Source={x:Static fmt:NpaOpener.KnownSchemes}, Mode=OneWay}"/>
SelectedIndex="{Binding Source={x:Static p:Settings.Default}, Path=NPAScheme, Mode=TwoWay}"/>
</Grid> </Grid>

View File

@ -1,5 +1,6 @@
using System.Windows; using System.Windows;
using System.Windows.Controls; using System.Windows.Controls;
using System.Linq;
using GameRes.Formats.Properties; using GameRes.Formats.Properties;
namespace GameRes.Formats.GUI namespace GameRes.Formats.GUI
@ -12,6 +13,8 @@ namespace GameRes.Formats.GUI
public WidgetNPA () public WidgetNPA ()
{ {
InitializeComponent(); InitializeComponent();
var sorted = NpaOpener.KnownSchemes.Skip (1).OrderBy (x => x);
Scheme.ItemsSource = NpaOpener.KnownSchemes.Take(1).Concat (sorted);
Scheme.SelectedItem = NpaOpener.KnownSchemes[(int)Settings.Default.NPAScheme]; Scheme.SelectedItem = NpaOpener.KnownSchemes[(int)Settings.Default.NPAScheme];
} }