public ApplicationMessage Create(MessageType msgType, string msgText, string methodName, string methodDeclaringTypeName, string methodAssemblyName) { ApplicationMessage result = new ApplicationMessage(); string tmpMessage = msgText.Replace("\n", String.Empty); tmpMessage = tmpMessage.Replace("\r", String.Empty); tmpMessage = tmpMessage.Replace("\t", " "); result.MsgDateTime = DateTime.Now; result.Message = tmpMessage; result.MsgType = msgType; result.MethodName = methodName; result.MethodDeclaringTypeName = methodDeclaringTypeName; result.MethodDeclaringTypeAssemblyName = methodAssemblyName; PublishMessageInListView(result); ApplicationMessage.PublishWithLoggerServices(result); return(result); }
public void LogMessage(MessageType type, string msg, MethodBase methodInfo) { ApplicationMessage appMsg = new ApplicationMessage(type, msg, methodInfo); ApplicationMessage.PublishWithLoggerServices(appMsg); }