Пример #1
0
 protected void OnGotSubscriptionRequest(PresenceItemEventArgs e)
 {
     if (GotSubscriptionRequest != null)
     {
         GotSubscriptionRequest(this, e);
     }
 }
Пример #2
0
 protected void OnGotPresenceItem(PresenceItemEventArgs e)
 {
     if (GotPresenceItem != null)
     {
         GotPresenceItem(this, e);
     }
 }
Пример #3
0
        protected void OnPresenceChanged(PresenceItemEventArgs e)
        {
            EventHandler <PresenceItemEventArgs> eh = (EventHandler <PresenceItemEventArgs>)(Events[PresenceChangedEvent]);

            if (eh != null)
            {
                eh(this, e);
            }
        }
Пример #4
0
 protected void OnGotSubscriptionRequest(PresenceItemEventArgs e)
 {
     if (GotSubscriptionRequest != null)
         GotSubscriptionRequest (this, e);
 }
Пример #5
0
 protected void OnGotPresenceItem(PresenceItemEventArgs e)
 {
     if (GotPresenceItem != null)
         GotPresenceItem (this, e);
 }
Пример #6
0
        private void PresenceChanged(object sender, PresenceItemEventArgs e)
        {
            RosterItem ri = (RosterItem)sender;
            jabber.protocol.client.Presence pres = ri.GetPresence ();

            if (pres == null) {
                StatusBarPanel1.Text = string.Format ("{0} is offline.", ri.GetDisplayName ());
                StatusBarPanel1.Visible = true;
            } else {
                switch (pres.Type) {
                    case jabber.protocol.client.PresenceType.available:
                        switch (pres.Show) {
                            case "away":
                            case "xa":
                            case "dnd":
                                if (pres.Status == null)
                                    StatusBarPanel1.Text = string.Format ("{0} is away.", ri.GetDisplayName ());
                                else
                                    StatusBarPanel1.Text = string.Format ("{0} is away. {1}", ri.GetDisplayName (), pres.Status.Trim ().Length > 0 ? string.Format (" ({0})", pres.Status.Trim ()) : string.Empty);

                                StatusBarPanel1.Visible = true;
                                break;
                            default:
                                StatusBarPanel1.Visible = false;
                                break;
                        }
                        break;
                    case jabber.protocol.client.PresenceType.unavailable:
                        StatusBarPanel1.Text = string.Format ("{0} is offline.", ri.GetDisplayName ());
                        StatusBarPanel1.Visible = true;
                        break;
                }
            }

            UserAvatar.Image = ri.Avatar;
        }
Пример #7
0
 protected void OnPresenceChanged(PresenceItemEventArgs e)
 {
     EventHandler<PresenceItemEventArgs> eh = (EventHandler<PresenceItemEventArgs>)(Events[PresenceChangedEvent]);
     if (eh != null)
         eh (this, e);
 }