public void SetData(Dictionary <string, object> data)
        {
            UserID = DataParser.GetInt(data, KEY_USER_ID);

            Status = DataParser.ArrayFromData <DataKeyValue>(data, KEY_STATUS);
            Dictionary <string, int> statusDictionary = new Dictionary <string, int>(Status.Length);

            for (int i = 0; i < Status.Length; i++)
            {
                int statusValue;

                if (int.TryParse(Status[i].Value, out statusValue))
                {
                    statusDictionary[Status[i].Key] = statusValue;
                }
            }

            NewMessagesFromContact    = statusDictionary.Get(KEY_MESSAGE_CONTACT, 0);
            NewAssignmentsFromContact = statusDictionary.Get(KEY_ASSIGNMENT_NEW, 0);
        }
Пример #2
0
 public static int GetInt(Dictionary <string, object> data, string key)
 {
     return(DataParser.GetInt(data, key));
 }