protected virtual void OnMessage(MessageReceivedArge e) { EventHandler <MessageReceivedArge> handler = OnMessageReceived; if (handler != null) { handler(this, e); } }
public void AddMessage(string Message = "Empty Message", Log.Type type = Log.Type.Unkhown) { Log log = new Log(); log.SetMessage(Message, type); list.Add(log); MessageReceivedArge arge = new MessageReceivedArge(); arge.log = log; OnMessage(arge); }
private void Logger_OnMessageReceived(object sender, MSC.MessageReceivedArge e) { Color col = Color.Black; switch (e.log.typeT) { case Log.Type.Error: col = Color.Red; break; case Log.Type.Infomation: col = Color.Blue; break; case Log.Type.OutPut: col = Color.Green; break; } AppendText(e.log.GetMessage(true), col); }