mirror of
https://github.com/microsoft/PowerToys.git
synced 2026-04-08 12:18:50 +02:00
Better logger
1. Throw exception for fatal/error log when debugging 2. Write to debug output for warn/debug/info log when debugging 3. part of #355
This commit is contained in:
@@ -9,7 +9,7 @@ namespace Wox.Helper
|
||||
{
|
||||
public static void Report(Exception e)
|
||||
{
|
||||
Log.Error(ExceptionFormatter.FormatExcpetion(e));
|
||||
Log.Fatal(e);
|
||||
new CrashReporter.CrashReporter(e).Show();
|
||||
}
|
||||
|
||||
|
||||
@@ -9,6 +9,7 @@ using Wox.Plugin;
|
||||
namespace Wox.Helper
|
||||
{
|
||||
class ListBoxItems : ObservableCollection<Result>
|
||||
// todo implement custom moveItem,removeItem,insertItem
|
||||
{
|
||||
public void RemoveAll(Predicate<Result> predicate)
|
||||
{
|
||||
@@ -21,7 +22,10 @@ namespace Wox.Helper
|
||||
|
||||
OnPropertyChanged(new PropertyChangedEventArgs("Count"));
|
||||
OnPropertyChanged(new PropertyChangedEventArgs("Item[]"));
|
||||
// fuck ms http://blogs.msdn.com/b/nathannesbit/archive/2009/04/20/addrange-and-observablecollection.aspx
|
||||
// fuck ms
|
||||
// http://blogs.msdn.com/b/nathannesbit/archive/2009/04/20/addrange-and-observablecollection.aspx
|
||||
// http://geekswithblogs.net/NewThingsILearned/archive/2008/01/16/listcollectionviewcollectionview-doesnt-support-notifycollectionchanged-with-multiple-items.aspx
|
||||
// PS: don't use Reset for other data updates, it will cause UI flickering
|
||||
OnCollectionChanged(new NotifyCollectionChangedEventArgs(NotifyCollectionChangedAction.Reset));
|
||||
}
|
||||
}
|
||||
|
||||
@@ -32,6 +32,7 @@ using IDataObject = System.Windows.IDataObject;
|
||||
using KeyEventArgs = System.Windows.Input.KeyEventArgs;
|
||||
using MenuItem = System.Windows.Forms.MenuItem;
|
||||
using MessageBox = System.Windows.MessageBox;
|
||||
using Stopwatch = Wox.Infrastructure.Stopwatch;
|
||||
using ToolTip = System.Windows.Controls.ToolTip;
|
||||
|
||||
namespace Wox
|
||||
@@ -852,10 +853,14 @@ namespace Wox
|
||||
|
||||
private void UpdateResultViewInternal(List<Result> list)
|
||||
{
|
||||
Dispatcher.Invoke(new Action(() =>
|
||||
if (list != null && list.Count > 0)
|
||||
{
|
||||
pnlResult.AddResults(list);
|
||||
}));
|
||||
Dispatcher.Invoke(new Action(() =>
|
||||
{
|
||||
Stopwatch.Normal($"UI update cost for {list[0].PluginDirectory.Split('\\').Last()}",
|
||||
() =>{pnlResult.AddResults(list);});
|
||||
}));
|
||||
}
|
||||
}
|
||||
|
||||
private Result GetTopMostContextMenu(Result result)
|
||||
|
||||
Reference in New Issue
Block a user