mirror of
https://github.com/microsoft/PowerToys.git
synced 2026-04-06 11:16:51 +02:00
Refactoring.
This commit is contained in:
@@ -4,6 +4,7 @@
|
||||
xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006"
|
||||
xmlns:d="http://schemas.microsoft.com/expression/blend/2008"
|
||||
xmlns:infrastructure="clr-namespace:Wox.Infrastructure;assembly=Wox.Infrastructure"
|
||||
xmlns:program="clr-namespace:Wox.Plugin.SystemPlugins.Program"
|
||||
mc:Ignorable="d"
|
||||
d:DesignHeight="300" d:DesignWidth="600">
|
||||
|
||||
@@ -26,7 +27,7 @@
|
||||
<GridViewColumn Header="Location" Width="400">
|
||||
<GridViewColumn.CellTemplate>
|
||||
<DataTemplate>
|
||||
<TextBlock Text="{Binding Location, ConverterParameter=(null), Converter={infrastructure:StringEmptyConverter}}"/>
|
||||
<TextBlock Text="{Binding Location, ConverterParameter=(null), Converter={program:StringEmptyConverter}}"/>
|
||||
</DataTemplate>
|
||||
</GridViewColumn.CellTemplate>
|
||||
</GridViewColumn>
|
||||
|
||||
26
Wox.Plugin.SystemPlugins/Program/StringEmptyConverter.cs
Normal file
26
Wox.Plugin.SystemPlugins/Program/StringEmptyConverter.cs
Normal file
@@ -0,0 +1,26 @@
|
||||
using System;
|
||||
using System.Windows.Data;
|
||||
using System.Windows.Markup;
|
||||
|
||||
namespace Wox.Plugin.SystemPlugins.Program
|
||||
{
|
||||
public class StringEmptyConverter : MarkupExtension, IValueConverter
|
||||
{
|
||||
public object Convert(object value, Type targetType, object parameter, System.Globalization.CultureInfo culture)
|
||||
{
|
||||
return string.IsNullOrEmpty((string)value) ? parameter : value;
|
||||
}
|
||||
|
||||
public object ConvertBack(
|
||||
object value, Type targetType, object parameter, System.Globalization.CultureInfo culture)
|
||||
{
|
||||
throw new NotSupportedException();
|
||||
}
|
||||
|
||||
|
||||
public override object ProvideValue(IServiceProvider serviceProvider)
|
||||
{
|
||||
return this;
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -8,7 +8,7 @@ using Wox.Infrastructure.Storage.UserSettings;
|
||||
|
||||
namespace Wox.Plugin.SystemPlugins
|
||||
{
|
||||
public class ThirdpartyPluginIndicator : BaseSystemPlugin
|
||||
public class UserPluginIndicator : BaseSystemPlugin
|
||||
{
|
||||
private List<PluginPair> allPlugins = new List<PluginPair>();
|
||||
private PluginInitContext context;
|
||||
@@ -86,6 +86,7 @@
|
||||
<Compile Include="Program\ProgramSuffixes.xaml.cs">
|
||||
<DependentUpon>ProgramSuffixes.xaml</DependentUpon>
|
||||
</Compile>
|
||||
<Compile Include="Program\StringEmptyConverter.cs" />
|
||||
<Compile Include="SuggestionSources\Baidu.cs" />
|
||||
<Compile Include="SuggestionSources\SuggestionSourceFactory.cs" />
|
||||
<Compile Include="Sys\SysSettings.xaml.cs">
|
||||
@@ -102,7 +103,7 @@
|
||||
<Compile Include="Program\Programs.cs" />
|
||||
<Compile Include="Properties\AssemblyInfo.cs" />
|
||||
<Compile Include="Sys\Sys.cs" />
|
||||
<Compile Include="ThirdpartyPluginIndicator.cs" />
|
||||
<Compile Include="UserPluginIndicator.cs" />
|
||||
<Compile Include="SuggestionSources\Google.cs" />
|
||||
<Compile Include="SuggestionSources\ISuggestionSource.cs" />
|
||||
<Compile Include="WebSearch\WebSearchSetting.xaml.cs">
|
||||
|
||||
Reference in New Issue
Block a user