diff options
| author | Roy Ben Shabat <Roy.mail.net@gmail.com> | 2020-04-12 17:47:21 +0300 |
|---|---|---|
| committer | Roy Ben Shabat <Roy.mail.net@gmail.com> | 2020-04-12 17:47:21 +0300 |
| commit | d26e810aa206bf850622ded5a0da76293cb12f13 (patch) | |
| tree | 38d8bcca3690c70f46a330aa0ec75adc964e500d /Software/Visual_Studio/Tango.SharedUI | |
| parent | e1802508c00e0cede200d3914c5b6e4587cb6963 (diff) | |
| download | Tango-d26e810aa206bf850622ded5a0da76293cb12f13.tar.gz Tango-d26e810aa206bf850622ded5a0da76293cb12f13.zip | |
FSE TFP.
Diffstat (limited to 'Software/Visual_Studio/Tango.SharedUI')
| -rw-r--r-- | Software/Visual_Studio/Tango.SharedUI/Converters/FilePathToFileNameConverter.cs | 36 | ||||
| -rw-r--r-- | Software/Visual_Studio/Tango.SharedUI/Tango.SharedUI.csproj | 3 |
2 files changed, 38 insertions, 1 deletions
diff --git a/Software/Visual_Studio/Tango.SharedUI/Converters/FilePathToFileNameConverter.cs b/Software/Visual_Studio/Tango.SharedUI/Converters/FilePathToFileNameConverter.cs new file mode 100644 index 000000000..7c59f8de7 --- /dev/null +++ b/Software/Visual_Studio/Tango.SharedUI/Converters/FilePathToFileNameConverter.cs @@ -0,0 +1,36 @@ +using System; +using System.Collections.Generic; +using System.Globalization; +using System.IO; +using System.Linq; +using System.Text; +using System.Threading.Tasks; +using System.Windows.Data; + +namespace Tango.SharedUI.Converters +{ + public class FilePathToFileNameConverter : IValueConverter + { + public object Convert(object value, Type targetType, object parameter, CultureInfo culture) + { + try + { + if (value != null) + { + return Path.GetFileName(value.ToString()); + } + } + catch + { + return value; + } + + return value; + } + + public object ConvertBack(object value, Type targetType, object parameter, CultureInfo culture) + { + throw new NotImplementedException(); + } + } +} diff --git a/Software/Visual_Studio/Tango.SharedUI/Tango.SharedUI.csproj b/Software/Visual_Studio/Tango.SharedUI/Tango.SharedUI.csproj index a649d0c1a..63bc3f833 100644 --- a/Software/Visual_Studio/Tango.SharedUI/Tango.SharedUI.csproj +++ b/Software/Visual_Studio/Tango.SharedUI/Tango.SharedUI.csproj @@ -112,6 +112,7 @@ <Compile Include="Converters\EnumToItemsSourceConverter.cs" /> <Compile Include="Converters\EnumToVisibilityConverter.cs" /> <Compile Include="Converters\EnumToXamlVectorConverter.cs" /> + <Compile Include="Converters\FilePathToFileNameConverter.cs" /> <Compile Include="Converters\IsEqualConverter.cs" /> <Compile Include="Converters\IsNotConverter.cs" /> <Compile Include="Converters\IsNullToVisibilityConverter.cs" /> @@ -256,7 +257,7 @@ <Import Project="$(MSBuildToolsPath)\Microsoft.CSharp.targets" /> <ProjectExtensions> <VisualStudio> - <UserProperties BuildVersion_AssemblyInfoFilename="Properties\AssemblyInfo.cs" BuildVersion_UpdateAssemblyVersion="True" BuildVersion_BuildVersioningStyle="None.None.Increment.TimeStamp" BuildVersion_UseGlobalSettings="False" BuildVersion_StartDate="2000/1/1" /> + <UserProperties BuildVersion_StartDate="2000/1/1" BuildVersion_UseGlobalSettings="False" BuildVersion_BuildVersioningStyle="None.None.Increment.TimeStamp" BuildVersion_UpdateAssemblyVersion="True" BuildVersion_AssemblyInfoFilename="Properties\AssemblyInfo.cs" /> </VisualStudio> </ProjectExtensions> </Project>
\ No newline at end of file |
