using System; using System.Collections.Generic; using System.ComponentModel; using System.Data; using System.Drawing; using System.Text; using System.Windows.Forms; using HotelPms.Share.Data; using HotelPms.Share.Util; using HotelPms.Share.Windows.Util; namespace HotelPms.Share.Windows.Tool { public partial class DebugMonitor : Form { public DebugMonitor() { InitializeComponent(); GeneralSub.SetDoubleBuffered(listBox1); } private void listBox1_DoubleClick(object sender, EventArgs e) { try { Clipboard.SetDataObject(listBox1.SelectedItem, true); } catch { } } public void WriteLog(string msg) { try { //textBox2.Text = MsSqlNet.ConnectCount.ToString(); if (cbFillter.Checked) { cbFillter.Tag = false; foreach (string sp in this.textBox3.Text.Split(new char[] { ',' })) { if (msg.Contains(sp)) { cbFillter.Tag = true; break; } } if (cbFillter.Tag.Equals(false)) return; } string newMsg = string.Format("y{0}z ", DateTime.Now.ToString("yyyy/MM/dd HH:mm:ss fff")) + msg; if (listBox1.Items.Count == int.MaxValue) { listBox1.Items.RemoveAt(0); } listBox1.Items.Add(newMsg); listBox1.SelectedIndex = listBox1.Items.Count - 1; listBox1.Refresh(); } catch { } } private void DebugMonitor_FormClosing(object sender, FormClosingEventArgs e) { if (e.CloseReason == CloseReason.UserClosing) { this.Visible = false; e.Cancel = true; } } private void btnClear_Click(object sender, EventArgs e) { listBox1.Items.Clear(); } private void DebugMonitor_Load(object sender, EventArgs e) { this.Location = new Point(0, 0); } private void cbTopMost_CheckedChanged(object sender, EventArgs e) { this.TopMost = cbTopMost.Checked; } private void label1_Click(object sender, EventArgs e) { //textBox2.Text = MsSqlNet.ConnectCount.ToString(); } } }