public void AdaptFacebookObj(FacebookObject i_PostToAdapt) { if (i_PostToAdapt is Post) { this.Name = (i_PostToAdapt as Post).Name; this.Message = (i_PostToAdapt as Post).Message; this.LikedBy = CollectionAdapter.AdaptCollection <UserAdapter, User>((i_PostToAdapt as Post).LikedBy); this.CreatedTime = (i_PostToAdapt as Post).CreatedTime; } else { throw new Exception("trying to adapt into a PostAdapter an object that is not a Facebook Post"); } }
public void AdaptFacebookObj(FacebookObject i_AlbumToAdapt) { if (i_AlbumToAdapt is Album) { this.Name = (i_AlbumToAdapt as Album).Name; this.Message = (i_AlbumToAdapt as Album).Message; this.LikedBy = CollectionAdapter.AdaptCollection <UserAdapter, User>((i_AlbumToAdapt as Album).LikedBy); this.ImageSmall = (i_AlbumToAdapt as Album).ImageSmall; } else { throw new Exception("trying to adapt into a AlbumAdatper an object that is not a Facebook album"); } }
public void AdaptFacebookObj(FacebookObject i_UserToAdapt) { if (i_UserToAdapt is User) { this.Posts = CollectionAdapter.AdaptCollection <PostAdapter, Post>((i_UserToAdapt as User).Posts); this.Albums = CollectionAdapter.AdaptCollection <AlbumAdapter, Album>((i_UserToAdapt as User).Albums); this.Friends = CollectionAdapter.AdaptCollection <UserAdapter, User>((i_UserToAdapt as User).Friends); this.FirstName = (i_UserToAdapt as User).FirstName; this.Name = (i_UserToAdapt as User).Name; this.LastName = (i_UserToAdapt as User).LastName; this.ImageNormal = (i_UserToAdapt as User).ImageNormal; } else { throw new Exception("trying to adapt into a User Adapter an object that is not a Facebook User"); } }