Fixed: output filename label doesn't display underscores

This commit is contained in:
Tichau committed 2015-10-27 08:05:21 +01:00
1 parent 228217e79b
commit 6f7b0386cd
5 files changed
+45 -8

No files matched your search

@@ -68,5 +68,21 @@ namespace FileConverter.Properties {
return ResourceManager.GetString("OuputFileNameTemplateSample", resourceCulture);
}
}
/// <summary>
/// Looks up a localized string similar to (p): input file path
///(f): input filename
///(o): output extension type
///(i): input extension type
///(d0): input parent folder
///(d1): input sub parent folder
///...
///use maj for uppercase version.
/// </summary>
public static string OutputFilePathTemplateHelp {
get {
return ResourceManager.GetString("OutputFilePathTemplateHelp", resourceCulture);
}
}
}
}
@@ -120,4 +120,14 @@
<data name="OuputFileNameTemplateSample" xml:space="preserve">
<value>C:\Data\MyFolder\SomeMusic.wav</value>
</data>
<data name="OutputFilePathTemplateHelp" xml:space="preserve">
<value>(p): input file path
(f): input filename
(o): output extension type
(i): input extension type
(d0): input parent folder
(d1): input sub parent folder
...
use maj for uppercase version</value>
</data>
</root>
@@ -120,4 +120,14 @@
<data name="OuputFileNameTemplateSample" xml:space="preserve">
<value>C:\Data\MyFolder\Default.wav</value>
</data>
<data name="OutputFilePathTemplateHelp" xml:space="preserve">
<value>(p): input file path
(f): input filename
(o): output extension type
(i): input extension type
(d0): input parent folder
(d1): input sub parent folder
...
use maj for uppercase version</value>
</data>
</root>
@@ -65,6 +65,7 @@ namespace FileConverter.ValueConverters
for (int index = 0; index < directories.Length; index++)
{
outputPath = outputPath.Replace(string.Format("(d{0})", directories.Length - index - 1), directories[index]);
outputPath = outputPath.Replace(string.Format("(D{0})", directories.Length - index - 1), directories[index].ToUpperInvariant());
}
outputPath += "." + outputExtension;
@@ -206,19 +206,19 @@
<RowDefinition Height="23"/>
</Grid.RowDefinitions>
<Label Content="File name template" Grid.Row="0" HorizontalContentAlignment="Right" Margin="0,0,5,0"/>
<TextBox Name="FileNameTemplateTextBox" Grid.Row="0" Grid.Column="1" Margin="5,2,25,2" Text="{Binding SelectedPreset.OutputFileNameTemplate, Mode=TwoWay, ElementName=window, UpdateSourceTrigger=PropertyChanged, ValidatesOnDataErrors=True}" TextWrapping="Wrap" Width="Auto" />
<Label Content="Input example" Grid.Row="1" HorizontalContentAlignment="Right" Margin="0,0,5,0" Foreground="Gray" FontSize="10"/>
<Label Content="{x:Static project:Resources.OuputFileNameTemplateSample}" Grid.Row="1" Grid.Column="1" Margin="5,0,5,0" Foreground="Gray" FontSize="10"/>
<Label Content="Output" Grid.Row="2" HorizontalContentAlignment="Right" Margin="0,0,5,0" Foreground="Gray" FontSize="10"/>
<Label x:Name="label" Grid.Row="2" Grid.Column="1" Margin="5,0,5,0" Foreground="Gray" FontSize="10">
<Label.Content>
<TextBox Name="FileNameTemplateTextBox" Grid.Row="0" Grid.Column="1" Margin="5,2,25,2" Text="{Binding SelectedPreset.OutputFileNameTemplate, Mode=TwoWay, ElementName=window, UpdateSourceTrigger=PropertyChanged, ValidatesOnDataErrors=True}" TextWrapping="Wrap" Width="Auto" ToolTip="{x:Static project:Resources.OutputFilePathTemplateHelp}" />
<Label Content="Input example" Grid.Row="1" Grid.Column="0" HorizontalContentAlignment="Right" Margin="0,0,5,0" Foreground="Gray" FontSize="10"/>
<TextBlock Text="{x:Static project:Resources.OuputFileNameTemplateSample}" Grid.Row="1" Grid.Column="1" Margin="5,0,5,0" Foreground="Gray" FontSize="10" VerticalAlignment="Center"/>
<Label Content="Output" Grid.Row="2" Grid.Column="0" HorizontalContentAlignment="Right" Margin="0,0,5,0" Foreground="Gray" FontSize="10"/>
<TextBlock Grid.Row="2" Grid.Column="1" Margin="5,0,5,0" Foreground="Gray" FontSize="10" VerticalAlignment="Center">
<TextBlock.Text>
<MultiBinding Converter="{StaticResource FileNameConverter}">
<Binding Source="{x:Static project:Resources.OuputFileNameTemplateSample}"/>
<Binding ElementName="window" Path="SelectedPreset.OutputType" Mode="OneWay"/>
<Binding ElementName="window" Path="SelectedPreset.OutputFileNameTemplate" Mode="OneWay"/>
</MultiBinding>
</Label.Content>
</Label>
</TextBlock.Text>
</TextBlock>
<!--Content="{Binding Source={x:Static project:Resources.OuputFileNameTemplateSample}, Converter={StaticResource FileNameConverter}}"/>-->
</Grid>
</StackPanel>