mirror of
https://github.com/microsoft/PowerToys.git
synced 2026-04-08 04:07:40 +02:00
Extract all converters into separate folder
This commit is contained in:
18
Wox/Converters/StringEmptyConverter.cs
Normal file
18
Wox/Converters/StringEmptyConverter.cs
Normal file
@@ -0,0 +1,18 @@
|
||||
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;
|
||||
}
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user