Example #1
0
        /// <summary>
        ///		Interpreta un nodo XML con un usuario
        /// </summary>
        internal static User Parse(MLNode objMLUser)
        {
            User objUser = new User();

                // Obtiene los datos del usuario
                    objUser.ID = objMLUser.Attributes[cnstStrTagID].GetValue(0);
                    objUser.Name = objMLUser.Attributes[cnstStrTagName].Value;
                    objUser.ScreenName = objMLUser.Attributes[cnstStrTagScreenName].Value;
                    objUser.Location = objMLUser.Attributes[cnstStrTagLocation].Value;
                    objUser.Description = objMLUser.Attributes[cnstStrTagDescription].Value;
                    objUser.ProfileImage = objMLUser.Attributes[cnstStrTagProfileImageUrl].Value;
                    objUser.Url = objMLUser.Attributes[cnstStrTagUrl].Value;
                    objUser.IsProtected = objMLUser.Attributes[cnstStrTagProtected].GetValue(false);
                    objUser.FollowersCount = objMLUser.Attributes[cnstStrTagFollowersCount].GetValue(0);
                    objUser.ProfileBackgroundColor = objMLUser.Attributes[cnstStrTagProfileBackgroundColor].Value;
                    objUser.ProfileTextColor = objMLUser.Attributes[cnstStrTagProfileTextColor].Value;
                    objUser.ProfileLinkColor = objMLUser.Attributes[cnstStrTagProfileLinkColor].Value;
                    objUser.ProfileSidebarFillColor = objMLUser.Attributes[cnstStrTagProfileSidebarFillColor].Value;
                    objUser.ProfileSidebarBordeColor = objMLUser.Attributes[cnstStrTagProfileSidebarBorderColor].Value;
                    objUser.FriendsCount = objMLUser.Attributes[cnstStrTagFriendsCount].GetValue(0);
                    objUser.CreatedAt = objMLUser.Attributes[cnstStrTagCreatedAt].Value;
                    objUser.FavoritesCount = objMLUser.Attributes[cnstStrTagFavoritesCount].GetValue(0);
                    objUser.UtcOffset = objMLUser.Attributes[cnstStrTagUtcOfsset].GetValue(0);
                    objUser.TimeZone = objMLUser.Attributes[cnstStrTagTimeZone].Value;
                    objUser.ProfileBackgroundImageUrl = objMLUser.Attributes[cnstStrTagProfileBackgroundImageUrl].Value;
                    objUser.ProfileBackgroundTitle = objMLUser.Attributes[cnstStrTagProfileBackgroundTitle].Value;
                    objUser.Notifications = objMLUser.Attributes[cnstStrTagNotifications].Value;
                    objUser.GeoEnabled = objMLUser.Attributes[cnstStrTagGeoEnabled].GetValue(false);
                    objUser.Verified = objMLUser.Attributes[cnstStrTagVerified].GetValue(false);
                    objUser.Following = objMLUser.Attributes[cnstStrTagFolloging].GetValue(false);
                    objUser.StatusCount = objMLUser.Attributes[cnstStrTagStatusesCount].GetValue(0);
                    objUser.Language = objMLUser.Attributes[cnstStrTagLang].Value;
                    objUser.ContributorsEnabled = objMLUser.Attributes[cnstStrTagContributorsEnabled].GetValue(false);
                // Obtiene el estado
                    if (!string.IsNullOrEmpty(objMLUser.Nodes[StatusParser.cnstStrTagStatus].Name))
                        objUser.Status = StatusParser.Parse(objMLUser.Nodes[StatusParser.cnstStrTagStatus]);
                // Devuelve el usuario
                    return objUser;
        }
 public TwitterMessageUser(User objUser)
     : base(objUser.ID, objUser.CreatedAt)
 {
     User = objUser;
 }