예제 #1
0
        public static void AddChannel(Channel channel)
        {
            if (ConnectionFile.Instance().Connections.FirstOrDefault(p => (p is Channel && ((Channel)p).Name == channel.Name)
            && (p is Connection && channel.ParentConnection.Name == ((Connection)p).Name)) == null)
            {
                MainPage.RunActionOnUiThread(() =>
                {
                    ObservableCollection<AHistory> col = ConnectionFile.Instance().Connections;

                    col.Insert(col.IndexOf(channel.ParentConnection) + 1, channel);
                    ((BIRCViewModel)MainPage.currentDataContext).ServerSelection = channel;
                });
            }
        }
예제 #2
0
        public static bool IsUserIgnored(Channel channel, string nickname)
        {
            if (channel.Users == null || channel.Users.Count == 0)
            {
                if (channel.Ignored == Channel.IGNORED)
                    return true;
                else
                    return false;
            }

            Channel user = channel.Users.FirstOrDefault(p => p.Name == nickname);
            if (user == null)
                return false;
            if (user.Ignored == Channel.IGNORED)
                return true;
            else
                return false;
        }
예제 #3
0
파일: Channel.cs 프로젝트: charla-n/BIRC
 public void RemoveUser(Channel user)
 {
     MainPage.RunActionOnUiThread(() =>
     {
         Users.Remove(user);
     });
 }
예제 #4
0
파일: Channel.cs 프로젝트: charla-n/BIRC
 public void AddUser(Channel user)
 {
     MainPage.RunActionOnUiThread(() =>
     {
         Users.Add(user);
     });
 }
예제 #5
0
        public static void RemoveChannel(Channel channel)
        {
            MainPage.RunActionOnUiThread(() =>
            {
                ObservableCollection<AHistory> col = ConnectionFile.Instance().Connections;

                ((BIRCViewModel)MainPage.currentDataContext).ServerSelection = channel.ParentConnection;
                col.Remove(channel);
            });
        }
예제 #6
0
 public static void UnreadChannelOnInactive(Channel curChannel)
 {
     if (!curChannel.IsActive)
     {
         MainPage.RunActionOnUiThread(() =>
         {
             if (curChannel.Unread == 1)
                 curChannel.Unread = 2;
             else
                 curChannel.Unread = 1;
         });
     }
 }
예제 #7
0
파일: Connection.cs 프로젝트: charla-n/BIRC
 public void AddChannel(Channel channel)
 {
     Channels.Add(channel);
     MainPage.RunActionOnUiThread(() =>
     {
         MainPage.currentDataContext.Changed("");
     });
 }
예제 #8
0
파일: Command.cs 프로젝트: charla-n/BIRC
        private void LocalUser_JoinedChannel(object sender, IrcChannelEventArgs e)
        {
            e.Channel.MessageReceived += Channel_MessageReceived;
            e.Channel.ModesChanged += Channel_ModesChanged;
            e.Channel.NoticeReceived += Channel_NoticeReceived;
            e.Channel.TopicChanged += Channel_TopicChanged;
            e.Channel.UserInvited += Channel_UserInvited;
            e.Channel.UserJoined += Channel_UserJoined;
            e.Channel.UserKicked += Channel_UserKicked;
            e.Channel.UserLeft += Channel_UserLeft;
            e.Channel.UsersListReceived += Channel_UsersListReceived;

            Channel channel = new Channel()
            {
                Name = "   " + e.Channel.Name,
                RealName = e.Channel.Name,
                ParentConnection = connection,
                Command = connection.Command
            };
            ConnectionUtils.AddChannel(channel);
            connection.AddChannel(channel);
        }