private static void DrawChannel(string indent, IEnumerable<Channel> channels, IEnumerable<User> users, Channel c) { Console.WriteLine(indent + c.Name + (c.Temporary ? "(temp)" : "")); foreach (var user in users.Where(u => u.Channel == c)) Console.WriteLine(indent + "->" + user.Name); foreach (var channel in channels.Where(ch => ch.Parent == c.Id && ch.Parent != ch.Id)) DrawChannel(indent + "\t", channels, users, channel); }
private static void DrawChannel(string indent, IEnumerable<Channel> channels, IEnumerable<User> users, Channel c) { Console.WriteLine(indent + c.Name + (c.Temporary ? "(temp)" : "")); foreach (var user in users.Where(u => u.Channel.Equals(c))) { if (string.IsNullOrWhiteSpace(user.Comment)) Console.WriteLine(indent + "-> " + user.Name); else Console.WriteLine(indent + "-> " + user.Name + " (" + user.Comment + ")"); } foreach (var channel in channels.Where(ch => ch.Parent == c.Id && ch.Parent != ch.Id)) DrawChannel(indent + "\t", channels, users, channel); }
public void ChannelState(Packets.ChannelState channelState) { var channel = channels.AddOrUpdate(channelState.ChannelId, i => { return new Channel(channelState.ChannelId, channelState.Name, channelState.Parent) { Temporary = channelState.Temporary }; }, (i, c) => { c.Name = channelState.Name; return c; } ); if (channel.Id == 0) RootChannel = channel; }
protected virtual void ChannelLeft(Channel channel) { }
protected virtual void ChannelJoined(Channel channel) { }
protected override void ChannelLeft(Channel channel) { base.ChannelLeft(channel); if (channelLeftDelegate != null) channelLeftDelegate(this, channel); }
protected override void ChannelJoined(Channel channel) { base.ChannelJoined(channel); if (channelJoinedDelegate != null) channelJoinedDelegate(this, channel); }