Пример #1
0
 private void Session_Joined(object sender, IrcChannelEventArgs e)
 {
     if (e.IsSelf)
     {
         this.Invoke(() =>
         {
             var context = new ChatContext((IrcSession)sender, e.Channel);
             var state = App.Settings.Current.Windows.States[context.Key];
             if (state.IsDetached)
             {
                 var window = new ChannelWindow(new ChatControl(context));
                 window.Show();
             }
             else
             {
                 this.AddPage(context, true);
             }
         });
     }
 }
Пример #2
0
 private void Session_TopicChanged(object sender, IrcChannelEventArgs e)
 {
     if (!this.IsServer && this.Target.Equals(e.Channel))
     {
         this.BeginInvoke(() =>
             {
                 this.Write("Topic", string.Format("{0} changed topic to: {1}", e.Who.Nickname, e.Text));
                 _topic = e.Text;
                 this.SetTitle();
             });
     }
 }
Пример #3
0
 private void Session_Parted(object sender, IrcChannelEventArgs e)
 {
     if (!e.IsSelf && !this.IsServer && this.Target.Equals(e.Channel))
     {
         this.BeginInvoke(() =>
             {
                 this.Write("Part", string.Format("{0} ({1}@{2}) has left channel {3}",
                     e.Who.Nickname, e.Who.Username, e.Who.Hostname, this.Target.ToString()));
                 this.RemoveNick(e.Who.Nickname);
             });
     }
 }
Пример #4
0
 private void Session_Joined(object sender, IrcChannelEventArgs e)
 {
     if (!e.IsSelf && !this.IsServer && this.Target.Equals(e.Channel))
     {
         this.BeginInvoke(() =>
             {
                 this.Write("Join", string.Format("{0} ({1}@{2}) has joined channel {3}",
                     e.Who.Nickname, e.Who.Username, e.Who.Hostname, this.Target.ToString()));
                 this.AddNick(ChannelLevel.Normal, e.Who.Nickname);
             });
     }
 }
Пример #5
0
 private void Session_Parted(object sender, IrcChannelEventArgs e)
 {
     if (e.IsSelf)
     {
         this.Invoke(() =>
         {
             var context = this.FindPage((IrcSession)sender, e.Channel);
             if (context != null)
             {
                 this.RemovePage(context);
             }
         });
     }
 }