Esempio n. 1
0
 public ChannelUser(IClientConnection connection, IChannel channel, IUser user)
 {
     Connection = connection;
     Channel = channel;
     User = user;
     Modes = new Mode();
 }
Esempio n. 2
0
        public static ChannelUserModeType ModeFlags(Mode modes)
        {
            ChannelUserModeType flags = ChannelUserModeType.None;
            foreach(char mode in modes.Modes)
                flags |= ModeType(mode);

            return flags;
        }
Esempio n. 3
0
 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;
 }
Esempio n. 4
0
        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))
                ;
        }
Esempio n. 5
0
        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))
                ;
        }