C# 클래스 PhotoSharingApp.Universal.Services.PhotoDummyService

This is a dummy service implementation that returns static data. This data can be used for development purposes in order to have data available at design-time for layouting. This data can also be used to simulate fetching data from a real service.
상속: IPhotoService
파일 보기 프로젝트 열기: Microsoft/Appsample-Photosharing 1 사용 예제들

공개 메소드들

메소드 설명
CreateCategory ( string categoryName ) : Task

Creates a new category.

DeletePhoto ( Photo photo ) : System.Threading.Tasks.Task

Deletes the photo.

FulfillGold ( string productReceipt ) : Task

Fulfills gold on the service.

GetAvailableAuthenticationProviders ( ) : List

Gets the available authentication providers.

GetCategories ( ) : Task>

Retrieves all categories without thumbnails.

GetConfig ( ) : Task

Gets the configuration data.

GetCurrentUser ( ) : Task

Gets the current user.

GetHeroImages ( int count ) : Task>

Retrieves hero images.

GetLeaderboardData ( int mostGoldCategoriesCount, int mostGoldPhotosCount, int mostGoldUsersCount, int mostGivingUsersCount ) : Task

Gets the leaderboard statistical data

GetPhotoDetails ( string photoId ) : Task

Gets the photo details for the given photo id.

GetPhotosForCategoryId ( string categoryId, string continuationToken = null ) : Task>

Gets photos for the given category id.

GetPhotosForCurrentUser ( string continuationToken = null ) : Task>

Gets photos uploaded by the current user.

GetPhotosForUser ( User user, string continuationToken = null ) : Task>

Gets photos uploaded by the specified user.

GetTopCategories ( int categoryThumbnailsCount, string continuationToken = null ) : Task>

Retrieves top categories with thumbnails.

PhotoDummyService ( ) : System

Intialize static sample data for Categories, Users, Photos, Annotations and Leaderboards for using dummy service.

PostAnnotation ( Photo photo, string annotationText, int goldCount ) : Task

Posts the annotation.

RemoveAnnotation ( Annotation annotation ) : System.Threading.Tasks.Task

Removes the Annotation.

ReportAnnotation ( Annotation annotation ) : System.Threading.Tasks.Task

Reports the Annotation as inappropriate.

ReportPhoto ( Photo photo, ReportReason reportReason ) : System.Threading.Tasks.Task

Reports the photo as inappropriate.

RestoreSignInStatusAsync ( ) : System.Threading.Tasks.Task

Checks if credentials are available and not expired, which are then used to restore the sign in status. The user is not actively taken to a login page.

SignInAsync ( MobileServiceAuthenticationProvider provider ) : System.Threading.Tasks.Task

Signs the user in.

SignOutAsync ( ) : System.Threading.Tasks.Task

Signs the user out.

UpdatePhoto ( Photo photo ) : System.Threading.Tasks.Task

Updates the photo.

UpdateUserProfilePhoto ( Photo photo ) : Task

Updates the current user's profile photo

UploadPhoto ( Stream stream, string localPath, string caption, string categoryId ) : Task

Uploads the photo.

비공개 메소드들

메소드 설명
GetWaitTime ( ) : System.TimeSpan
InitAnnotations ( ) : void
InitCategories ( ) : void
InitLeaderboardData ( ) : void
InitPhotoStreams ( ) : void
InitSampleUsers ( ) : void
InitTopCategories ( ) : void
InitUser ( ) : void
SimulateWaitAndError ( ) : System.Threading.Tasks.Task

Simulates an error in every second call. Can be disabled by setting IsErrorSimulationEnabled variable to false.

메소드 상세

CreateCategory() 공개 메소드

Creates a new category.
public CreateCategory ( string categoryName ) : Task
categoryName string The category name.
리턴 Task

DeletePhoto() 공개 메소드

Deletes the photo.
public DeletePhoto ( Photo photo ) : System.Threading.Tasks.Task
photo PhotoSharingApp.Universal.Models.Photo The photo.
리턴 System.Threading.Tasks.Task

FulfillGold() 공개 메소드

Fulfills gold on the service.
public FulfillGold ( string productReceipt ) : Task
productReceipt string The product receipt.
리턴 Task

GetAvailableAuthenticationProviders() 공개 메소드

Gets the available authentication providers.
public GetAvailableAuthenticationProviders ( ) : List
리턴 List

GetCategories() 공개 메소드

Retrieves all categories without thumbnails.
public GetCategories ( ) : Task>
리턴 Task>

GetConfig() 공개 메소드

Gets the configuration data.
public GetConfig ( ) : Task
리턴 Task

GetCurrentUser() 공개 메소드

Gets the current user.
public GetCurrentUser ( ) : Task
리턴 Task

GetHeroImages() 공개 메소드

Retrieves hero images.
public GetHeroImages ( int count ) : Task>
count int Number of hero images.
리턴 Task>

GetLeaderboardData() 공개 메소드

Gets the leaderboard statistical data
public GetLeaderboardData ( int mostGoldCategoriesCount, int mostGoldPhotosCount, int mostGoldUsersCount, int mostGivingUsersCount ) : Task
mostGoldCategoriesCount int
mostGoldPhotosCount int
mostGoldUsersCount int
mostGivingUsersCount int
리턴 Task

GetPhotoDetails() 공개 메소드

Gets the photo details for the given photo id.
public GetPhotoDetails ( string photoId ) : Task
photoId string The photo identifier.
리턴 Task

GetPhotosForCategoryId() 공개 메소드

Gets photos for the given category id.
public GetPhotosForCategoryId ( string categoryId, string continuationToken = null ) : Task>
categoryId string The identifier.
continuationToken string Optional. The continuation token. By default, null.
리턴 Task>

GetPhotosForCurrentUser() 공개 메소드

Gets photos uploaded by the current user.
public GetPhotosForCurrentUser ( string continuationToken = null ) : Task>
continuationToken string Optional. The continuation token. By default, null.
리턴 Task>

GetPhotosForUser() 공개 메소드

Gets photos uploaded by the specified user.
public GetPhotosForUser ( User user, string continuationToken = null ) : Task>
user PhotoSharingApp.Universal.Models.User The user.
continuationToken string Optional. The continuation token. By default, null.
리턴 Task>

GetTopCategories() 공개 메소드

Retrieves top categories with thumbnails.
public GetTopCategories ( int categoryThumbnailsCount, string continuationToken = null ) : Task>
categoryThumbnailsCount int The number of thumbnails per each category.
continuationToken string Optional. The continuation token. By default, null.
리턴 Task>

PhotoDummyService() 공개 메소드

Intialize static sample data for Categories, Users, Photos, Annotations and Leaderboards for using dummy service.
public PhotoDummyService ( ) : System
리턴 System

PostAnnotation() 공개 메소드

Posts the annotation.
public PostAnnotation ( Photo photo, string annotationText, int goldCount ) : Task
photo PhotoSharingApp.Universal.Models.Photo The photo.
annotationText string The text.
goldCount int The amount of gold being given.
리턴 Task

RemoveAnnotation() 공개 메소드

Removes the Annotation.
public RemoveAnnotation ( Annotation annotation ) : System.Threading.Tasks.Task
annotation PhotoSharingApp.Universal.Models.Annotation The Annotation.
리턴 System.Threading.Tasks.Task

ReportAnnotation() 공개 메소드

Reports the Annotation as inappropriate.
public ReportAnnotation ( Annotation annotation ) : System.Threading.Tasks.Task
annotation PhotoSharingApp.Universal.Models.Annotation The Annotation.
리턴 System.Threading.Tasks.Task

ReportPhoto() 공개 메소드

Reports the photo as inappropriate.
public ReportPhoto ( Photo photo, ReportReason reportReason ) : System.Threading.Tasks.Task
photo PhotoSharingApp.Universal.Models.Photo The photo.
reportReason ReportReason The reason for the report.
리턴 System.Threading.Tasks.Task

RestoreSignInStatusAsync() 공개 메소드

Checks if credentials are available and not expired, which are then used to restore the sign in status. The user is not actively taken to a login page.
public RestoreSignInStatusAsync ( ) : System.Threading.Tasks.Task
리턴 System.Threading.Tasks.Task

SignInAsync() 공개 메소드

Signs the user in.
public SignInAsync ( MobileServiceAuthenticationProvider provider ) : System.Threading.Tasks.Task
provider MobileServiceAuthenticationProvider The provider.
리턴 System.Threading.Tasks.Task

SignOutAsync() 공개 메소드

Signs the user out.
public SignOutAsync ( ) : System.Threading.Tasks.Task
리턴 System.Threading.Tasks.Task

UpdatePhoto() 공개 메소드

Updates the photo.
public UpdatePhoto ( Photo photo ) : System.Threading.Tasks.Task
photo PhotoSharingApp.Universal.Models.Photo The photo.
리턴 System.Threading.Tasks.Task

UpdateUserProfilePhoto() 공개 메소드

Updates the current user's profile photo
public UpdateUserProfilePhoto ( Photo photo ) : Task
photo PhotoSharingApp.Universal.Models.Photo The new profile photo
리턴 Task

UploadPhoto() 공개 메소드

Uploads the photo.
public UploadPhoto ( Stream stream, string localPath, string caption, string categoryId ) : Task
stream Stream The memory stream.
localPath string The local path.
caption string The caption.
categoryId string The id of the assocaited category.
리턴 Task