public ChannelUser(IClientConnection connection, IChannel channel, IUser user) { Connection = connection; Channel = channel; User = user; Modes = new Mode(); }
public static ChannelUserModeType ModeFlags(Mode modes) { ChannelUserModeType flags = ChannelUserModeType.None; foreach(char mode in modes.Modes) flags |= ModeType(mode); return flags; }
public static ChannelUserModeType HighestMode(Mode mode) { ChannelUserModeType flags = ModeFlags(mode); if((flags & ChannelUserModeType.Owner) != 0) return ChannelUserModeType.Owner; else if((flags & ChannelUserModeType.Protected) != 0) return ChannelUserModeType.Protected; else if((flags & ChannelUserModeType.Op) != 0) return ChannelUserModeType.Op; else if((flags & ChannelUserModeType.HalfOp) != 0) return ChannelUserModeType.HalfOp; else if((flags & ChannelUserModeType.Voice) != 0) return ChannelUserModeType.Voice; return ChannelUserModeType.None; }
public Channel(IClientConnection connection, String name, SynchronizationContext context) { _context = context; _users = new SynchronizedKeyedCollection<String, IChannelUser>(_context); _knownUsers = new SynchronizedKeyedCollection<String, IChannelUser>(_context); Connection = connection; Name = new ObservableProperty<String>(name); Modes = new Mode(); Topic = new ObservableProperty<String>(String.Empty); TopicSetBy = new ObservableProperty<IUser>(null); TopicSetDate = new ObservableProperty<uint>(0); CreatedDate = new ObservableProperty<uint>(0); ReceivedMessages = connection.ReceivedMessages .Where(m => m.Receiver.Equals(this)) ; }
public User(IClientConnection connection, String name, SynchronizationContext context) { _context = context; _channels = new SynchronizedKeyedCollection<String, IChannel>(_context); _knownChannels = new SynchronizedKeyedCollection<String, IChannel>(_context); Connection = connection; Identity = new Identity(name, null, null); RealName = new ObservableProperty<String>(String.Empty); Network = new ObservableProperty<INetwork>(null); Modes = new Mode(); Away = new ObservableProperty<bool>(false); Name = new ObservableProperty<String>(name); ReceivedMessages = connection.ReceivedMessages .Where(m => m.Receiver.Equals(this)) ; SentMessages = connection.ReceivedMessages .Where(m => m.Sender.Equals(this)) ; }