Replace Dispose with Lambda

1. Faster
2. Fix #361
This commit is contained in:
bao-qian
2015-11-04 21:35:04 +00:00
parent 57a06aa122
commit df0f310ddd
6 changed files with 67 additions and 57 deletions

View File

@@ -70,15 +70,12 @@ namespace Wox.Plugin.Program
{
this.context = context;
this.context.API.ResultItemDropEvent += API_ResultItemDropEvent;
using (new Timeit("Preload programs"))
Timeit.StopwatchDebug("Preload programs", () =>
{
programs = ProgramCacheStorage.Instance.Programs;
}
Debug.WriteLine(string.Format("Preload {0} programs from cache", programs.Count));
using (new Timeit("Program Index"))
{
IndexPrograms();
}
});
Debug.WriteLine($"Preload {programs.Count} programs from cache");
Timeit.StopwatchDebug("Program Index", IndexPrograms);
}
void API_ResultItemDropEvent(Result result, IDataObject dropObject, DragEventArgs e)