PowerToys/src/modules/launcher/Plugins/Microsoft.Plugin.Program/SuffixesConverter.cs
2020-08-14 12:46:23 -07:00

37 lines
1020 B
C#

// Copyright (c) Microsoft Corporation
// The Microsoft Corporation licenses this file to you under the MIT license.
// See the LICENSE file in the project root for more information.
using System;
using System.Globalization;
using System.Windows.Data;
using System.Windows.Markup;
namespace Microsoft.Plugin.Program
{
public class SuffixesConverter : MarkupExtension, IValueConverter
{
public object Convert(object value, Type targetType, object parameter, CultureInfo culture)
{
if (value is string[] text)
{
return string.Join(";", text);
}
else
{
return string.Empty;
}
}
public object ConvertBack(object value, Type targetType, object parameter, CultureInfo culture)
{
throw new NotSupportedException();
}
public override object ProvideValue(IServiceProvider serviceProvider)
{
return this;
}
}
}