void OnReadLineHandler(object sender, Irc.ReadLineEventArgs e) { if (OnReadLine != null) { OnReadLine((Network)sender, e); } }
private void _SimpleParser(object sender, ReadLineEventArgs args) { string rawline = args.Line; string[] rawlineex = rawline.Split(new char[] { ' ' }); string messagecode = ""; if (rawline[0] == ':') { messagecode = rawlineex[1]; try { ReplyCode replycode = (ReplyCode)int.Parse(messagecode); switch (replycode) { case ReplyCode.Welcome: _IsRegistered = true; #if LOG4NET Logger.Connection.Info("logged in"); #endif break; } } catch (FormatException) { // nothing } } else { messagecode = rawlineex[0]; switch (messagecode) { case "ERROR": IsConnectionError = true; break; } } }
private void _SimpleParser(object sender, ReadLineEventArgs args) { string rawline = args.Line; string[] rawlineex = rawline.Split(new char[] {' '}); string messagecode = ""; if (rawline[0] == ':') { messagecode = rawlineex[1]; try { ReplyCode replycode = (ReplyCode)int.Parse(messagecode); switch(replycode) { case ReplyCode.Welcome: _IsRegistered = true; #if LOG4NET Logger.Connection.Info("logged in"); #endif break; } } catch (FormatException) { // nothing } } else { messagecode = rawlineex[0]; switch(messagecode) { case "ERROR": IsConnectionError = true; break; } } }
private void _Worker(object sender, ReadLineEventArgs e) { // lets see if we have events or internal messagehandler for it _HandleEvents(MessageParser(e.Line)); }