void client_ChannelListReceived(object sender, IrcChannelListReceivedEventArgs e) { var client = (IrcClient)sender; foreach (var channel in e.Channels) { client.SendRawMessage("JOIN " + channel.Name); } }
private static void ClientOnChannelListReceived(object sender, IrcChannelListReceivedEventArgs ircChannelListReceivedEventArgs) { foreach (var c in ircChannelListReceivedEventArgs.Channels) { var tc = c; client.Channels.Join(c.Name); var task = new Task( () => { while (client.Channels.FirstOrDefault(x => x.Name == tc.Name) == null) { Thread.Sleep(10); } channels.Add(new ChannelBot(client.Channels.First(x => x.Name == tc.Name))); }); task.Start(); } }
private static void ClientOnChannelListReceived(object sender, IrcChannelListReceivedEventArgs ircChannelListReceivedEventArgs) { Log("Got those channels yo"); gotChannels = true; foreach (var c in ircChannelListReceivedEventArgs.Channels) { Log("Trying to join channel " + c.Name); var tc = c; client.Channels.Join(c.Name); var task = new Task( () => { while (client.Channels.FirstOrDefault(x => x.Name == tc.Name) == null) { Thread.Sleep(10); } Log("WOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOO"); ; channels.Add(new ChannelBot(client.Channels.First(x => x.Name == tc.Name))); }); task.Start(); } }
/// <summary> /// </summary> /// <param name="sender"> /// </param> /// <param name="e"> /// </param> protected abstract void client_ChannelListReceived(object sender, IrcChannelListReceivedEventArgs e);
/// <summary> /// </summary> /// <param name="sender"> /// </param> /// <param name="e"> /// </param> protected override void client_ChannelListReceived(object sender, IrcChannelListReceivedEventArgs e) { if (e.Channels.Count > 0) { foreach (IrcChannelInfo channelInfo in e.Channels) { this.client.Channels.Join(new[] { channelInfo.Name }); } } }
/// <summary> /// Raises the <see cref="ChannelListReceived"/> event. /// </summary> /// <param name="e">The <see cref="IrcChannelListReceivedEventArgs"/> instance containing the event data. /// </param> protected virtual void OnChannelListReceived(IrcChannelListReceivedEventArgs e) { var handler = this.ChannelListReceived; if (handler != null) handler(this, e); }
protected void ircClient_ChannelListReceived(object sender, IrcChannelListReceivedEventArgs e) { this.allChannels.Clear(); foreach (var channelInfo in e.Channels) { BindableChannelInfo info = new BindableChannelInfo() { Name = channelInfo.Name, VisibleUsersCount = channelInfo.VisibleUsersCount, Topic = channelInfo.Topic }; this.allChannels.Add(info); if (Regex.IsMatch(channelInfo.Name, this.Pattern, RegexOptions.Compiled)) { this.Channels.Add(info); } } }
/// <summary> /// Ircs the ircClient on channel list received. /// </summary> /// <param name="sender"> /// The sender. /// </param> /// <param name="e"> /// The <see cref="IrcChannelListReceivedEventArgs"/> instance containing the event data. /// </param> private void IrcClientOnChannelListReceived(object sender, IrcChannelListReceivedEventArgs e) { this.channels = new List<string>(from info in e.Channels select info.Name); }
private void Client_ChannelListReceived(object sender, IrcChannelListReceivedEventArgs e) { StringBuilder builder = new StringBuilder(); foreach (IrcChannelInfo info in e.Channels) builder.Append(HtmlWriter.Write(string.Format(MainPage.GetInfoString("ListChannel"), info.Name, info.Topic, info.VisibleUsersCount))); if (e.Channels.Count == 0) builder.Append(HtmlWriter.Write(MainPage.GetInfoString("NoChannels"))); connection.AddHistory(builder.ToString()); }