/// <summary> /// Constructor of the UserObject. /// Contains all arguments the SlimUserObject always has, so those have to be set. /// </summary> public UserObject(int id, string screen_name, string display_name, string def_avatar, string def_header, UserFlagObject flags, bool banned, bool allow_stranger_answers) { Id = id; ScreenName = screen_name; OptionalName = display_name; Avatar = new AvatarObject(def_avatar); Header = new HeaderObject(def_header); Flags = flags; Banned = new UserBannedObject(banned); AllowStrangerAnswers = allow_stranger_answers; }
public static UserFlagObject fromDynamic(dynamic userflagData) { UserFlagObject flags = new UserFlagObject() { Admin = userflagData.admin, Moderator = userflagData.moderator, Supporter = userflagData.supporter, Blogger = userflagData.blogger, Contributor = userflagData.contributor, Translator = userflagData.translator, AppDeveloper = userflagData.app_developer }; return(flags); }
public static UserObject fromDynamicSlim(dynamic userData) { if (userData == null) { return(null); } UserObject user = new UserObject() { Id = userData.id, ScreenName = userData.screen_name, OptionalName = userData.display_name, Avatar = new AvatarObject((string)userData.avatar), Header = new HeaderObject((string)userData.header), Flags = UserFlagObject.fromDynamic(userData.flags), Banned = new UserBannedObject((bool)userData.banned), AllowStrangerAnswers = userData.privacy_allow_stranger_answers }; return(user); }
/// <summary> /// Constructor of the UserObject. /// Contains all arguments the SlimUserObject always has, so those have to be set. /// </summary> public UserObject(int id, string screen_name, string display_name, string def_avatar, string def_header, UserFlagObject flags, bool banned, bool allow_stranger_answers) { Id = id; ScreenName = screen_name; OptionalName = display_name; Avatar = new AvatarObject(def_avatar); Header = new HeaderObject(def_header); Flags = flags; Banned = new UserBannedObject(banned); AllowStrangerAnswers = allow_stranger_answers; }
public static UserFlagObject fromDynamic(dynamic userflagData) { UserFlagObject flags = new UserFlagObject() { Admin = userflagData.admin, Moderator = userflagData.moderator, Supporter = userflagData.supporter, Blogger = userflagData.blogger, Contributor = userflagData.contributor, Translator = userflagData.translator, AppDeveloper = userflagData.app_developer }; return flags; }