Compare commits
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
24f8aefefa | ||
|
|
07af80d3ae | ||
|
|
8dd0470bcf | ||
|
|
dc878569ad |
+1
-1
@@ -1 +1 @@
|
|||||||
1.0.23
|
1.0.26
|
||||||
|
|||||||
@@ -6,10 +6,10 @@
|
|||||||
<LangVersion>7.3</LangVersion>
|
<LangVersion>7.3</LangVersion>
|
||||||
<RootNamespace>MonsterMonitor</RootNamespace>
|
<RootNamespace>MonsterMonitor</RootNamespace>
|
||||||
<AssemblyName>devenv</AssemblyName>
|
<AssemblyName>devenv</AssemblyName>
|
||||||
<AssemblyVersion>1.0.23</AssemblyVersion>
|
<AssemblyVersion>1.0.26</AssemblyVersion>
|
||||||
<Version>1.0.23</Version>
|
<Version>1.0.26</Version>
|
||||||
<FileVersion>1.0.23</FileVersion>
|
<FileVersion>1.0.26</FileVersion>
|
||||||
<InformationalVersion>1.0.23</InformationalVersion>
|
<InformationalVersion>1.0.26</InformationalVersion>
|
||||||
</PropertyGroup>
|
</PropertyGroup>
|
||||||
<ItemGroup>
|
<ItemGroup>
|
||||||
<PackageReference Include="Costura.Fody" Version="6.0.0">
|
<PackageReference Include="Costura.Fody" Version="6.0.0">
|
||||||
|
|||||||
@@ -1,11 +1,10 @@
|
|||||||
using MonsterMonitor.Models;
|
|
||||||
using MonsterMonitor.Services;
|
|
||||||
using System;
|
using System;
|
||||||
using System.Drawing;
|
using System.Drawing;
|
||||||
using System.Runtime.InteropServices;
|
using System.Runtime.InteropServices;
|
||||||
using System.Threading.Tasks;
|
using System.Threading.Tasks;
|
||||||
using System.Windows.Forms;
|
using System.Windows.Forms;
|
||||||
using static System.Net.Mime.MediaTypeNames;
|
using MonsterMonitor.Models;
|
||||||
|
using MonsterMonitor.Services;
|
||||||
|
|
||||||
namespace MonsterMonitor.UI
|
namespace MonsterMonitor.UI
|
||||||
{
|
{
|
||||||
@@ -30,7 +29,7 @@ namespace MonsterMonitor.UI
|
|||||||
|
|
||||||
public MainForm()
|
public MainForm()
|
||||||
{
|
{
|
||||||
Text = string.Format("Monster Monitor v{0}", System.Windows.Forms.Application.ProductVersion);
|
Text = string.Format("Monster Monitor v{0}", Application.ProductVersion);
|
||||||
Width = 980;
|
Width = 980;
|
||||||
Height = 620;
|
Height = 620;
|
||||||
StartPosition = FormStartPosition.CenterScreen;
|
StartPosition = FormStartPosition.CenterScreen;
|
||||||
@@ -191,18 +190,11 @@ namespace MonsterMonitor.UI
|
|||||||
|
|
||||||
private void AppendLog(LogEntry entry)
|
private void AppendLog(LogEntry entry)
|
||||||
{
|
{
|
||||||
if (_console.Text.Length > 100000)
|
|
||||||
{
|
|
||||||
_console.ResetText();
|
|
||||||
}
|
|
||||||
System.Windows.Forms.Application.DoEvents();
|
|
||||||
|
|
||||||
if (InvokeRequired)
|
if (InvokeRequired)
|
||||||
{
|
{
|
||||||
BeginInvoke(new Action<LogEntry>(AppendLog), entry);
|
BeginInvoke(new Action<LogEntry>(AppendLog), entry);
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
System.Windows.Forms.Application.DoEvents();
|
|
||||||
|
|
||||||
var wasNearBottom = IsConsoleNearBottom();
|
var wasNearBottom = IsConsoleNearBottom();
|
||||||
var firstVisibleLineBeforeAppend = GetFirstVisibleLine(_console);
|
var firstVisibleLineBeforeAppend = GetFirstVisibleLine(_console);
|
||||||
@@ -212,14 +204,12 @@ namespace MonsterMonitor.UI
|
|||||||
_console.SelectionColor = GetColor(entry.Level);
|
_console.SelectionColor = GetColor(entry.Level);
|
||||||
_console.AppendText($"[{entry.Timestamp:HH:mm:ss}] [{entry.Level}] {entry.Message}{Environment.NewLine}");
|
_console.AppendText($"[{entry.Timestamp:HH:mm:ss}] [{entry.Level}] {entry.Message}{Environment.NewLine}");
|
||||||
_console.SelectionColor = _console.ForeColor;
|
_console.SelectionColor = _console.ForeColor;
|
||||||
System.Windows.Forms.Application.DoEvents();
|
|
||||||
|
|
||||||
if (wasNearBottom)
|
if (wasNearBottom)
|
||||||
{
|
{
|
||||||
_console.ScrollToCaret();
|
_console.ScrollToCaret();
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
System.Windows.Forms.Application.DoEvents();
|
|
||||||
|
|
||||||
var firstVisibleLineAfterAppend = GetFirstVisibleLine(_console);
|
var firstVisibleLineAfterAppend = GetFirstVisibleLine(_console);
|
||||||
var linesToRestore = firstVisibleLineBeforeAppend - firstVisibleLineAfterAppend;
|
var linesToRestore = firstVisibleLineBeforeAppend - firstVisibleLineAfterAppend;
|
||||||
@@ -227,7 +217,6 @@ namespace MonsterMonitor.UI
|
|||||||
{
|
{
|
||||||
SendMessage(_console.Handle, EmLineScroll, IntPtr.Zero, (IntPtr)linesToRestore);
|
SendMessage(_console.Handle, EmLineScroll, IntPtr.Zero, (IntPtr)linesToRestore);
|
||||||
}
|
}
|
||||||
System.Windows.Forms.Application.DoEvents();
|
|
||||||
}
|
}
|
||||||
|
|
||||||
private bool IsConsoleNearBottom()
|
private bool IsConsoleNearBottom()
|
||||||
|
|||||||
Reference in New Issue
Block a user