Refactoring.

This commit is contained in:
qianlifeng
2014-12-26 22:51:04 +08:00
parent 50f6044a2f
commit ccc8d7e5cd
27 changed files with 114 additions and 139 deletions

View File

@@ -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>

View 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;
}
}
}

View File

@@ -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;

View File

@@ -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">