protected void OnMessage(MessageEventArgs e) { if (Message != null) { Message(this, e); } }
private void OnMessage(object sender, MessageEventArgs args) { bool printPrompt = false; switch (args.Type) { case EventType.ADD_NODE_ERROR: case EventType.PARSE_ERROR: case EventType.ERROR: case EventType.CLIPSPARSER_ERROR: System.Exception ex = args.Message as System.Exception; if (ex != null) Console.Out.WriteLine(ex.Message); else Console.Out.WriteLine(args.Message); Console.Out.Write(Constants.SHELL_PROMPT); break; case EventType.RESULT: string msg = args.Message.ToString(); if (String.IsNullOrEmpty(msg) == false) Console.Out.WriteLine(msg); Console.Out.Write(Constants.SHELL_PROMPT); break; case EventType.ENGINE: string msg1 = args.Message.ToString(); Console.Out.Write(msg1); break; case EventType.COMMAND: break; case EventType.ADD_RULE_EVENT: case EventType.REMOVE_RULE_EVENT: case EventType.INVALID_RULE: case EventType.RULE_EXISTS: case EventType.TEMPLATE_NOTFOUND: case EventType.CLIPSPARSER_WARNING: case EventType.CLIPSPARSER_REINIT: case EventType.FUNCTION_NOT_FOUND: case EventType.FUNCTION_INVALID: throw new ApplicationException(string.Format("Unexpected EventType: {0}", args.Type)); } }
/// <summary> /// Posts the message event. /// </summary> /// <param name="messageEventArgsRenamed">The event_ renamed.</param> private void postMessageEvent(MessageEventArgs messageEventArgsRenamed) { if (Message != null) { Message(this, messageEventArgsRenamed); } }
private void OnChannelMessage(object sender, MessageEventArgs e) { postMessageEvent(e); }
private void engine_Message(object sender, MessageEventArgs e) { postMessageEvent(e); }