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; }); } }
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; }
public void RemoveUser(Channel user) { MainPage.RunActionOnUiThread(() => { Users.Remove(user); }); }
public void AddUser(Channel user) { MainPage.RunActionOnUiThread(() => { Users.Add(user); }); }
public static void RemoveChannel(Channel channel) { MainPage.RunActionOnUiThread(() => { ObservableCollection<AHistory> col = ConnectionFile.Instance().Connections; ((BIRCViewModel)MainPage.currentDataContext).ServerSelection = channel.ParentConnection; col.Remove(channel); }); }
public static void UnreadChannelOnInactive(Channel curChannel) { if (!curChannel.IsActive) { MainPage.RunActionOnUiThread(() => { if (curChannel.Unread == 1) curChannel.Unread = 2; else curChannel.Unread = 1; }); } }
public void AddChannel(Channel channel) { Channels.Add(channel); MainPage.RunActionOnUiThread(() => { MainPage.currentDataContext.Changed(""); }); }
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); }