PowerToys/Wox/Converters/StringEmptyConverter.cs
2014-05-24 14:06:09 +06:00

18 lines
491 B
C#

using System;
using System.Globalization;
namespace Wox.Converters
{
public class StringEmptyConverter : ConvertorBase<StringEmptyConverter>
{
public override object Convert(object value, Type targetType, object parameter, CultureInfo culture)
{
return string.IsNullOrEmpty((string)value) ? parameter : value;
}
public override object ProvideValue(IServiceProvider serviceProvider)
{
return this;
}
}
}