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"
MaxWidth="250">
<ComboBox Name="Scheme" Width="180"
ItemsSource="{Binding Source={x:Static fmt:NpaOpener.KnownSchemes}, Mode=OneWay}"
SelectedIndex="{Binding Source={x:Static p:Settings.Default}, Path=NPAScheme, Mode=TwoWay}"/>
ItemsSource="{Binding Source={x:Static fmt:NpaOpener.KnownSchemes}, Mode=OneWay}"/>
</Grid>

View File

@ -1,5 +1,6 @@
using System.Windows;
using System.Windows.Controls;
using System.Linq;
using GameRes.Formats.Properties;
namespace GameRes.Formats.GUI
@ -12,6 +13,8 @@ namespace GameRes.Formats.GUI
public WidgetNPA ()
{
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];
}