/// <summary> /// ReceiveCtcpReply イベントを発生させます。 /// </summary> protected void OnReceiveCtcpReply(CtcpEventArgs e) { CtcpEventHandler handler = (CtcpEventHandler)Events[eventKeyOfReceiveCtcpReply]; if (handler != null) { Control owner = GetOwner(); if ((owner != null) && owner.InvokeRequired) { owner.Invoke(handler, this, e); } else { handler(this, e); } } }
/// <summary> /// CTCP�N�G����M�����Ƃ� /// </summary> private void ircClient_ReceiveCtcpQuery(object sender, CtcpEventArgs e) { switch (e.Command.ToUpper()) { case "VERSION": e.Reply = Resources.CtcpVersion; break; case "SOURCE": e.Reply = Resources.CtcpSource; break; case "PING": e.Reply = e.Parameter; break; case "TIME": e.Reply = System.DateTime.Now.ToString(); break; case "CLIENTINFO": e.Reply = "CLIENTINFO VERSION SOURCE PING TIME"; break; } }
/// <summary> /// ReceiveCtcpQuery イベントを発生させます。 /// </summary> protected void OnReceiveCtcpQuery(CtcpEventArgs e) { CtcpEventHandler handler = (CtcpEventHandler)Events[eventKeyOfReceiveCtcpQuery]; if (handler != null) { Control owner = GetOwner(); if ((owner != null) && owner.InvokeRequired) { owner.Invoke(handler, this, e); } else { handler(this, e); } if (e.Reply != string.Empty) { SendCtcpReply(e.Sender, string.Format("{0} {1}", e.Command, e.Reply)); } } }