Exemple #1
0
 private void UpdateGuiContactProperties(Session selectedSession)
 {
     try {
         if (selectedSession == null)
         {
             return;
         }
         GUIPropertyManager.SetProperty(TAG_CONTACT_AVATAR_IMAGE, Cache.GetAvatarImagePath(selectedSession.ContactDetails));
         GUIPropertyManager.SetProperty(TAG_CONTACT_NAME_NICK, selectedSession.ContactNickname);
         GUIPropertyManager.SetProperty(TAG_CONTACT_LAST_ACTIVE, selectedSession.DateTimeLastActive.ToShortTimeString());
         GUIPropertyManager.SetProperty(TAG_CONTACT_STATUS_TYPE, Translations.GetByName(selectedSession.Contact.status.type.ToString()));
         GUIPropertyManager.SetProperty(TAG_CONTACT_STATUS_IMAGE, Helper.GetStatusIcon(selectedSession.Contact.status.type.ToString()));
         GUIPropertyManager.SetProperty(TAG_CONTACT_STATUS_MESSAGE, selectedSession.Contact.status.message + " @ " + selectedSession.ContactJID.Resource);
         if (ctrlTextboxLastMessage != null)
         {
             ctrlTextboxLastMessage.Clear();
             if (selectedSession.Messages.Count > 0)
             {
                 ctrlTextboxLastMessage.Label = selectedSession.Messages.Last().ToString();
             }
         }
     } catch (Exception e) {
         Log.Error(e);
     }
 }
Exemple #2
0
 private IEnumerable <GUIListItem> BuildDialogSelectList(Type enumType)
 {
     foreach (string type in Enum.GetNames(enumType))
     {
         string iconPath = Helper.MEDIA_ICON_DEFAULT;
         if (enumType == typeof(Enums.StatusType))
         {
             iconPath = Helper.GetStatusIcon(type);
         }
         else if (enumType == typeof(Enums.MoodType))
         {
             iconPath = Helper.GetMoodIcon(type);
         }
         else if (enumType == typeof(Enums.ActivityType))
         {
             iconPath = Helper.GetActivityIcon(type);
         }
         yield return(Helper.CreateGuiListItem(type,
                                               Translations.GetByName(type.ToString()),
                                               String.Empty,
                                               String.Empty,
                                               iconPath,
                                               type == Enums.StatusType.Invisible.ToString(),
                                               null,
                                               false
                                               ));
     }
 }
Exemple #3
0
        public ContextMenuButtons ShowContextMenu(List <ContextMenuButtons> buttonCollection)
        {
            List <GUIListItem> tmpItemList = new List <GUIListItem>();

            foreach (ContextMenuButtons currentButton in buttonCollection)
            {
                tmpItemList.Add(new GUIListItem(Translations.GetByName(currentButton.ToString())));
            }
            try {
                return(buttonCollection[ShowDialogSelect(tmpItemList, false).selectedIndex]);
            } catch {
                return(ContextMenuButtons.NothingSelected);
            }
        }
Exemple #4
0
        private void UpdateGuiContactProperties()
        {
            if (_currentChatSession != null)
            {
                GUIPropertyManager.SetProperty(TAG_CONTACT_NAME_NICK, _currentChatSession.ContactDetails.nickname);
                GUIPropertyManager.SetProperty(TAG_CONTACT_STATUS_TYPE, Translations.GetByName(_currentChatSession.Contact.status.type.ToString()));
                GUIPropertyManager.SetProperty(TAG_CONTACT_STATUS_IMAGE, Helper.GetStatusIcon(_currentChatSession.Contact.status.type.ToString()));
                GUIPropertyManager.SetProperty(TAG_CONTACT_STATUS_MESSAGE, _currentChatSession.Contact.status.message);

                GUIPropertyManager.SetProperty(TAG_CONTACT_MOOD_TYPE, Translations.GetByName(_currentChatSession.Contact.mood.type.ToString()));
                GUIPropertyManager.SetProperty(TAG_CONTACT_MOOD_IMAGE, Helper.GetMoodIcon(_currentChatSession.Contact.mood.type.ToString()));
                GUIPropertyManager.SetProperty(TAG_CONTACT_MOOD_MESSAGE, _currentChatSession.Contact.mood.text);
                GUIPropertyManager.SetProperty(TAG_CONTACT_ACTIVITY_TYPE, Translations.GetByName(_currentChatSession.Contact.activity.type.ToString()));
                GUIPropertyManager.SetProperty(TAG_CONTACT_ACTIVITY_IMAGE, Helper.GetActivityIcon(_currentChatSession.Contact.activity.type.ToString()));
                GUIPropertyManager.SetProperty(TAG_CONTACT_ACTIVITY_MESSAGE, _currentChatSession.Contact.activity.text);
                GUIPropertyManager.SetProperty(TAG_CONTACT_TUNE_TITLE, _currentChatSession.Contact.tune.title);
                GUIPropertyManager.SetProperty(TAG_CONTACT_TUNE_MESSAGE, _currentChatSession.Contact.tune.artist);
            }
        }
Exemple #5
0
 private void UpdateGuiUserProperties()
 {
     if (Helper.JABBER_CLIENT.Presence != null)
     {
         Presence myPres = Helper.JABBER_CLIENT.Presence;
         GUIPropertyManager.SetProperty(TAG_USER_STATUS_TYPE, Translations.GetByName(myPres.status.type.ToString()));
         GUIPropertyManager.SetProperty(TAG_USER_STATUS_IMAGE, Helper.GetStatusIcon(myPres.status.type.ToString()));
         GUIPropertyManager.SetProperty(TAG_USER_STATUS_MESSAGE, myPres.status.message);
         GUIPropertyManager.SetProperty(TAG_USER_MOOD_TYPE, Translations.GetByName(myPres.mood.type.ToString()));
         GUIPropertyManager.SetProperty(TAG_USER_MOOD_IMAGE, Helper.GetMoodIcon(myPres.mood.type.ToString()));
         GUIPropertyManager.SetProperty(TAG_USER_MOOD_MESSAGE, myPres.mood.text);
         GUIPropertyManager.SetProperty(TAG_USER_ACTIVITY_TYPE, Translations.GetByName(myPres.activity.type.ToString()));
         GUIPropertyManager.SetProperty(TAG_USER_ACTIVITY_IMAGE, Helper.GetActivityIcon(myPres.activity.type.ToString()));
         GUIPropertyManager.SetProperty(TAG_USER_ACTIVITY_MESSAGE, myPres.activity.text);
         GUIPropertyManager.SetProperty(TAG_USER_TUNE_TITLE, myPres.tune.title);
         GUIPropertyManager.SetProperty(TAG_USER_TUNE_MESSAGE, myPres.tune.artist);
     }
     if (Helper.JABBER_CLIENT.Identity != null)
     {
         GUIPropertyManager.SetProperty(TAG_USER_NAME_NICK, Helper.JABBER_CLIENT.Identity.nickname);
     }
 }