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/Converters/FilePathToFileNameConverter.cs | |
| parent | e1802508c00e0cede200d3914c5b6e4587cb6963 (diff) | |
| download | Tango-d26e810aa206bf850622ded5a0da76293cb12f13.tar.gz Tango-d26e810aa206bf850622ded5a0da76293cb12f13.zip | |
FSE TFP.
Diffstat (limited to 'Software/Visual_Studio/Tango.SharedUI/Converters/FilePathToFileNameConverter.cs')
| -rw-r--r-- | Software/Visual_Studio/Tango.SharedUI/Converters/FilePathToFileNameConverter.cs | 36 |
1 files changed, 36 insertions, 0 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(); + } + } +} |
