public void MemoLogChange(System.Object Sender, System.EventArgs _e1) { if (MemoLog.Lines.Length > 100) { MemoLog.Clear(); } }
public void MemoLogDblClick(System.Object Sender, System.EventArgs _e1) { if (MessageBox.Show("是否确定清除日志信息!!!", "提示信息", MessageBoxButtons.YesNo, MessageBoxIcon.Question) == DialogResult.Yes) { MemoLog.Clear(); } }
/// <summary> /// 向Main窗口显示日志 /// </summary> private void ShowMainLogMsg() { if ((GameFramework.HUtil32.GetTickCount() - DBShare.g_dwShowMainLogTick) > 20) { DBShare.g_dwShowMainLogTick = GameFramework.HUtil32.GetTickCount(); List <string> TempLogList = new List <string>(); try { //移动到临时变量存储 DBShare.g_MainLogMsgList.__Lock(); try { for (int I = 0; I < DBShare.g_MainLogMsgList.Count; I++) { TempLogList.Add(DBShare.g_MainLogMsgList[I]); } DBShare.g_MainLogMsgList.Clear(); } finally { DBShare.g_MainLogMsgList.UnLock(); } for (int I = 0; I < TempLogList.Count; I++) { MemoLog.Invoke((MethodInvoker) delegate() { MemoLog.AppendText(TempLogList[I] + Environment.NewLine); }); } } finally { } } }