initial commit
This commit is contained in:
53
cVMS.NET_CS/Dialog/fLog.cs
Normal file
53
cVMS.NET_CS/Dialog/fLog.cs
Normal file
@@ -0,0 +1,53 @@
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.ComponentModel;
|
||||
using System.Data;
|
||||
using System.Drawing;
|
||||
using System.Linq;
|
||||
using System.Text;
|
||||
using System.Threading.Tasks;
|
||||
using System.Windows.Forms;
|
||||
|
||||
namespace vmsnet
|
||||
{
|
||||
public partial class fLog : Form
|
||||
{
|
||||
public fLog()
|
||||
{
|
||||
InitializeComponent();
|
||||
PUB.log.RaiseMsg += Log_RaiseMsg;
|
||||
this.FormClosed += (s1, e1) =>
|
||||
{
|
||||
PUB.log.RaiseMsg -= Log_RaiseMsg;
|
||||
this.Dispose();
|
||||
};
|
||||
}
|
||||
|
||||
|
||||
|
||||
private void Log_RaiseMsg(DateTime LogTime, string TypeStr, string Message)
|
||||
{
|
||||
addmsg(Message);
|
||||
}
|
||||
void addmsg(string mbox)
|
||||
{
|
||||
if (this.richTextBox1.InvokeRequired)
|
||||
{
|
||||
this.richTextBox1.BeginInvoke(new Action(() =>
|
||||
{
|
||||
this.richTextBox1.AppendText(mbox + "\n");
|
||||
this.richTextBox1.ScrollToCaret();
|
||||
}));
|
||||
}
|
||||
else
|
||||
{
|
||||
this.richTextBox1.AppendText(mbox + "\n");
|
||||
this.richTextBox1.ScrollToCaret();
|
||||
}
|
||||
}
|
||||
private void fLog_Load(object sender, EventArgs e)
|
||||
{
|
||||
|
||||
}
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user