Refactoring

This commit is contained in:
qianlifeng
2015-01-04 23:08:26 +08:00
parent 4d65b4c7a5
commit 6162904c59
10 changed files with 42 additions and 19 deletions

View File

@@ -3,7 +3,7 @@
"ActionKeyword":"*",
"Name":"Calculator",
"Description":"Provide mathematical calculations.(Try 5*3-2 in Wox)",
"Author":"qianlifeng",
"Author":"cxfksword",
"Version":"1.0.0",
"Language":"csharp",
"Website":"http://www.getwox.com/plugin",

View File

@@ -1,5 +1,6 @@
using System.Collections.Generic;
using System.Linq;
using Wox.Core.Plugin;
using Wox.Infrastructure.Storage.UserSettings;
namespace Wox.Plugin.PluginIndicator
@@ -16,7 +17,7 @@ namespace Wox.Plugin.PluginIndicator
if (allPlugins.Count == 0)
{
allPlugins = context.API.GetAllPlugins().Where(o => o.Metadata.ActionKeyword != "*").ToList();
allPlugins = context.API.GetAllPlugins().Where(o => !PluginManager.IsSystemPlugin(o.Metadata)).ToList();
}
foreach (PluginMetadata metadata in allPlugins.Select(o => o.Metadata))

View File

@@ -47,6 +47,10 @@
</None>
</ItemGroup>
<ItemGroup>
<ProjectReference Include="..\..\Wox.Core\Wox.Core.csproj">
<Project>{b749f0db-8e75-47db-9e5e-265d16d0c0d2}</Project>
<Name>Wox.Core</Name>
</ProjectReference>
<ProjectReference Include="..\..\Wox.Infrastructure\Wox.Infrastructure.csproj">
<Project>{4fd29318-a8ab-4d8f-aa47-60bc241b8da3}</Project>
<Name>Wox.Infrastructure</Name>

View File

@@ -1,5 +1,6 @@
using System;
using System.Collections.Generic;
using System.Diagnostics;
using System.Linq;
using System.Reflection;
using Wox.Infrastructure;
@@ -72,7 +73,11 @@ namespace Wox.Plugin.Program
public void Init(PluginInitContext context)
{
this.context = context;
programs = ProgramCacheStorage.Instance.Programs;
using (new Timeit("Preload programs"))
{
programs = ProgramCacheStorage.Instance.Programs;
}
Debug.WriteLine(string.Format("Preload {0} programs from cache",programs.Count),"Wox");
using (new Timeit("Program Index"))
{
IndexPrograms();