Skip to content

Commit

Permalink
Merge pull request #14 from pybride/main
Browse files Browse the repository at this point in the history
🐛 Corrected tree expand issue
  • Loading branch information
LiorBanai authored Dec 15, 2023
2 parents 656ceb0 + cc58612 commit 0994856
Show file tree
Hide file tree
Showing 4 changed files with 24 additions and 6 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@
<PackageIcon>icon.png</PackageIcon>
<PackageIconUrl />
<Description>Loggers tree extension</Description>
<VersionPrefix>3.0.0</VersionPrefix>
<VersionPrefix>3.0.1</VersionPrefix>
<VersionSuffix></VersionSuffix>
</PropertyGroup>

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -17,6 +17,7 @@ public class PrimaryFactory : global::Analogy.LogViewer.Template.PrimaryFactory

public override IEnumerable<IAnalogyChangeLog> ChangeLog { get; set; } = new List<AnalogyChangeLog>
{
new AnalogyChangeLog("Corrected tree expansion", AnalogChangeLogType.Bug, "CAMAG", new DateTime(2023, 11, 21), ""),
new AnalogyChangeLog("Update Nuget dependencies", AnalogChangeLogType.None, "Lior Banai", new DateTime(2023, 08, 04), ""),
new AnalogyChangeLog("Corrected loggers' name in case of C# generics, corrected SQL generation, prettified displayed SQL", AnalogChangeLogType.Bug, "CAMAG", new DateTime(2023, 04, 04), ""),
new AnalogyChangeLog("Corrected query and added auto resize", AnalogChangeLogType.Bug, "CAMAG", new DateTime(2023, 03, 22), ""),
Expand Down
19 changes: 18 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 All @@ -26,6 +27,7 @@ public partial class UcLoggersTree : UserControl
private readonly System.Timers.Timer timer;
private DockPanel? dockPanel;
private ControlContainer? container;
private bool isInitialized;

private enum LogLevel
{
Expand Down Expand Up @@ -77,6 +79,10 @@ public UcLoggersTree()

private void ReadAll()
{
if (IsDisposed)
{
return;
}
int sleep = 0;
for (int i = 0; i < MsgQueue.Count; i++)
{
Expand All @@ -93,7 +99,18 @@ private void ReadAll()
sleep = 0;
}
}
TrvLoggers.BeginInvoke((MethodInvoker)(() => { TrvLoggers.ExpandAll(); }));
if (!isInitialized)
{
#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;
}

private void ReadQueue(object? sender, ElapsedEventArgs elapsedEventArgs)
Expand Down
8 changes: 4 additions & 4 deletions Analogy.LogViewer.LoggersTree/Properties/launchSettings.json
Original file line number Diff line number Diff line change
Expand Up @@ -5,13 +5,13 @@
},
"Analogy Release": {
"commandName": "Executable",
"executablePath": "D:\\Projects\\Platypus\\Analogy.LogViewer\\Analogy.LogViewer\\Analogy\\bin\\Release\\net6.0-windows\\Analogy.exe",
"workingDirectory": "D:\\Projects\\Platypus\\Analogy.LogViewer\\Analogy.LogViewer\\Analogy\\bin\\Release\\net6.0-windows"
"executablePath": "D:\\Projects\\Analogy.LogViewer\\Analogy.LogViewer\\Analogy\\bin\\Release\\net8.0-windows\\Analogy.exe",
"workingDirectory": "D:\\Projects\\Analogy.LogViewer\\Analogy.LogViewer\\Analogy\\bin\\Release\\net8.0-windows"
},
"Analogy Debug": {
"commandName": "Executable",
"executablePath": "D:\\Projects\\Platypus\\Analogy.LogViewer\\Analogy.LogViewer\\Analogy\\bin\\Debug\\net6.0-windows\\Analogy.exe",
"workingDirectory": "D:\\Projects\\Platypus\\Analogy.LogViewer\\Analogy.LogViewer\\Analogy\\bin\\Debug\\net6.0-windows"
"executablePath": "D:\\Projects\\Analogy.LogViewer\\Analogy.LogViewer\\Analogy\\bin\\Debug\\net8.0-windows\\Analogy.exe",
"workingDirectory": "D:\\Projects\\Analogy.LogViewer\\Analogy.LogViewer\\Analogy\\bin\\Debug\\net8.0-windows"
}
}
}

0 comments on commit 0994856

Please sign in to comment.