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 T[] ArrayFromData <T>(Dictionary <string, object> data, string key) where T : IDataSettable, new()
 {
     return(DataParser.ArrayFromData <T>(data, key));
 }
Пример #3
0
 public static T[] ArrayFromData <T>(List <object> data) where T : IDataSettable, new()
 {
     return(DataParser.ArrayFromData <T>(data));
 }