Skip to content

Commit

Permalink
🩹Improved tree loading
Browse files Browse the repository at this point in the history
  • Loading branch information
pybride committed Nov 21, 2023
1 parent 1fcf000 commit cc58612
Showing 1 changed file with 13 additions and 1 deletion.
14 changes: 13 additions & 1 deletion Analogy.LogViewer.LoggersTree/LoggersTree/UcLoggersTree.cs
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,7 @@
using System.Drawing;
using System.Linq;
using System.Threading;
using System.Threading.Tasks;
using System.Timers;
using System.Windows.Forms;

Expand Down Expand Up @@ -78,6 +79,10 @@ public UcLoggersTree()

private void ReadAll()
{
if (IsDisposed)
{
return;
}
int sleep = 0;
for (int i = 0; i < MsgQueue.Count; i++)
{
Expand All @@ -96,7 +101,14 @@ private void ReadAll()
}
if (!isInitialized)
{
TrvLoggers.BeginInvoke((MethodInvoker)(() => { TrvLoggers.ExpandAll(); }));
#pragma warning disable MA0134
Task.Factory.StartNew(() =>
{
//wait for UI to be ready
Thread.Sleep(5000);
TrvLoggers.BeginInvoke((MethodInvoker)(() => { TrvLoggers.ExpandAll(); }));
}, TaskCreationOptions.LongRunning);
#pragma warning restore MA0134
}
isInitialized = true;
}
Expand Down

0 comments on commit cc58612

Please sign in to comment.