mirror of
https://github.com/crskycode/GARbro.git
synced 2024-10-23 07:38:16 +08:00
display only formats that implement Create method.
This commit is contained in:
parent
9fb51e57e3
commit
ef79d52e02
@ -42,7 +42,7 @@
|
|||||||
<Label Content="{x:Static s:guiStrings.LabelArchiveFormat}" Target="{Binding ElementName=ArchiveFormat}" HorizontalAlignment="Left"
|
<Label Content="{x:Static s:guiStrings.LabelArchiveFormat}" Target="{Binding ElementName=ArchiveFormat}" HorizontalAlignment="Left"
|
||||||
Padding="5,0,5,5"/>
|
Padding="5,0,5,5"/>
|
||||||
<ComboBox Name="ArchiveFormat" SelectedValuePath="Tag" SelectedValue="{Binding Source={x:Static p:Settings.Default}, Path=appArchiveFormat, Mode=TwoWay}"
|
<ComboBox Name="ArchiveFormat" SelectedValuePath="Tag" SelectedValue="{Binding Source={x:Static p:Settings.Default}, Path=appArchiveFormat, Mode=TwoWay}"
|
||||||
ItemsSource="{Binding Source={x:Static gr:FormatCatalog.Instance}, Path=ArcFormats, Mode=OneWay}"
|
ItemsSource="{Binding Path=ArcFormats, RelativeSource={RelativeSource FindAncestor, AncestorType={x:Type Window}}, Mode=OneWay}"
|
||||||
SelectionChanged="OnFormatSelect" DisplayMemberPath="Tag"/>
|
SelectionChanged="OnFormatSelect" DisplayMemberPath="Tag"/>
|
||||||
</StackPanel>
|
</StackPanel>
|
||||||
</Grid>
|
</Grid>
|
||||||
|
@ -2,6 +2,7 @@
|
|||||||
using System.Windows;
|
using System.Windows;
|
||||||
using System.Windows.Controls;
|
using System.Windows.Controls;
|
||||||
using System.Windows.Input;
|
using System.Windows.Input;
|
||||||
|
using System.Collections.Generic;
|
||||||
using System.Text;
|
using System.Text;
|
||||||
using System.Linq;
|
using System.Linq;
|
||||||
using Microsoft.Win32;
|
using Microsoft.Win32;
|
||||||
@ -23,10 +24,15 @@ namespace GARbro.GUI
|
|||||||
{
|
{
|
||||||
var format = this.ArchiveFormat.SelectedItem as ArchiveFormat;
|
var format = this.ArchiveFormat.SelectedItem as ArchiveFormat;
|
||||||
if (null != format)
|
if (null != format)
|
||||||
ArchiveName.Text = Path.ChangeExtension (initial_name, format.Extensions.First());
|
initial_name = Path.ChangeExtension (initial_name, format.Extensions.First());
|
||||||
}
|
}
|
||||||
|
ArchiveName.Text = initial_name;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
private readonly IEnumerable<ArchiveFormat> m_formats = FormatCatalog.Instance.ArcFormats.Where (f => f.CanCreate);
|
||||||
|
|
||||||
|
public IEnumerable<ArchiveFormat> ArcFormats { get { return m_formats; } }
|
||||||
|
|
||||||
public ResourceOptions ArchiveOptions { get; private set; }
|
public ResourceOptions ArchiveOptions { get; private set; }
|
||||||
|
|
||||||
void Button_Click (object sender, RoutedEventArgs e)
|
void Button_Click (object sender, RoutedEventArgs e)
|
||||||
|
Loading…
Reference in New Issue
Block a user