Пример #1
0
        private void RefreshTooltip()
        {
            ToolTip tip = new ToolTip();

            tip.Content          = RosterUtils.GetTooltip(riTo);
            tip.Background       = UiEnhancer.WhiteBrush;
            tip.BorderBrush      = UiEnhancer.DarkGrayBrush;
            tip.BorderThickness  = new Thickness(1);
            tip.Placement        = System.Windows.Controls.Primitives.PlacementMode.Right;
            tip.PlacementTarget  = PresenceGrid;
            PresenceGrid.ToolTip = tip;
        }
Пример #2
0
        private void RefreshAvatar()
        {
            if (Avatar.Exist(riTo.Presence.PhotoHash))
            {
                AvatarImg.AttachSource(Avatar.GetSource(riTo.Presence.PhotoHash), 32, 32);
            }
            else
            {
                AvatarImg.AttachSource(Icons.UserDefaultAvatarSource, 0, 0);
            }

            AvatarBorder.BorderThickness = new Thickness(1);
            AvatarBorder.BorderBrush     = RosterUtils.Presence2Brush(riTo.Presence.Status);
        }
Пример #3
0
        public void RefreshPresence()
        {
            if (riTo == null || riTo.Presence == null || riTo.Presence == XmppPresence.Empty)
            {
                return;
            }

            lbName.Text     = riTo.Text == riTo.Jid.Value ? riTo.Text : string.Format("{0} <{1}>", riTo.Text, riTo.Jid.Value);
            lbPresence.Text = string.Format("{0}{1}",
                                            RosterUtils.Presence2Str(riTo.Presence.Status),
                                            string.IsNullOrWhiteSpace(riTo.Presence.MessageStatus) ? " " : Environment.NewLine + riTo.Presence.MessageStatus);
            RefreshAvatar();
            RefreshTooltip();
        }
Пример #4
0
 private void RefreshAvatar()
 {
     if (ViewMode == RosterViewerMode.Default)
     {
         AvatarImg.AttachSource(RosterUtils.Presence2Ico(Presence.Status), null, null);
         AvatarBorder.BorderThickness = new Thickness(0);
     }
     else if (ViewMode == RosterViewerMode.BigAvatar)
     {
         ImageSource avatar = Avatar.Exist(Presence.PhotoHash) ?
                              Avatar.GetSource(Presence.PhotoHash) :
                              Icons.UserDefaultAvatarSource;
         AvatarImg.AttachSource(avatar, 32, 32);
         AvatarBorder.BorderThickness = new Thickness(1);
         AvatarBorder.BorderBrush     = RosterUtils.Presence2Brush(Presence.Status);
     }
 }
Пример #5
0
        public void RefreshPresence()
        {
            if (Presence == null || Presence == XmppPresence.Empty)
            {
                return;
            }

            string more = RosterUtils.Presence2Str(Presence.Status);

            if (ViewMode == RosterViewerMode.BigAvatar && !string.IsNullOrWhiteSpace(Presence.MessageStatus))
            {
                more += Environment.NewLine + Presence.MessageStatus;
            }
            lbPresence.Text = more;

            RefreshAvatar();
            RefreshTooltip();
        }