PowerToys/Plugins/Wox.Plugin.Program/LocationConverter.cs

34 lines
856 B
C#
Raw Normal View History

2014-03-29 14:42:43 +08:00
using System;
2016-01-07 05:34:42 +08:00
using System.Globalization;
2014-03-29 14:42:43 +08:00
using System.Windows.Data;
using System.Windows.Markup;
namespace Wox.Plugin.Program
2014-03-29 14:42:43 +08:00
{
public class LocationConverter : MarkupExtension, IValueConverter
2014-03-29 14:42:43 +08:00
{
2016-01-07 05:34:42 +08:00
public object Convert(object value, Type targetType, object parameter, CultureInfo culture)
2014-03-29 14:42:43 +08:00
{
var text = value as string;
if (string.IsNullOrEmpty(text))
{
return string.Empty;
}
else
{
return text;
}
2014-03-29 14:42:43 +08:00
}
public object ConvertBack(object value, Type targetType, object parameter, CultureInfo culture)
2014-03-29 14:42:43 +08:00
{
throw new NotSupportedException();
}
public override object ProvideValue(IServiceProvider serviceProvider)
{
return this;
}
}
}