mirror of
https://github.com/microsoft/PowerToys.git
synced 2026-04-08 20:27:36 +02:00
Refactoring Refactoring icon, part 2
1. Add baidu, fix #576, #582 2. Refactoring
This commit is contained in:
@@ -1,30 +0,0 @@
|
||||
using System;
|
||||
using System.Globalization;
|
||||
using System.Windows.Data;
|
||||
using System.Windows.Markup;
|
||||
|
||||
namespace Wox.Converters
|
||||
{
|
||||
public abstract class ConvertorBase<T> : MarkupExtension, IValueConverter where T : class, new()
|
||||
{
|
||||
private static T converter;
|
||||
|
||||
/// <summary>
|
||||
/// Must be implemented in inheritor.
|
||||
/// </summary>
|
||||
public abstract object Convert(object value, Type targetType, object parameter, CultureInfo culture);
|
||||
|
||||
/// <summary>
|
||||
/// Override if needed.
|
||||
/// </summary>
|
||||
public virtual object ConvertBack(object value, Type targetType, object parameter, CultureInfo culture)
|
||||
{
|
||||
throw new NotImplementedException();
|
||||
}
|
||||
|
||||
public override object ProvideValue(IServiceProvider serviceProvider)
|
||||
{
|
||||
return converter ?? (converter = new T());
|
||||
}
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user