public static async Task <Screenshot> GetAppScreenshotAsync(Guid appGuid, AppScreenshotType screenshotType, AppScreenshotSize screenshotSize, int screenshotIndex) { //var rootFilter = new HttpBaseProtocolFilter(); //rootFilter.CacheControl.ReadBehavior = Windows.Web.Http.Filters.HttpCacheReadBehavior.MostRecent; //rootFilter.CacheControl.WriteBehavior = Windows.Web.Http.Filters.HttpCacheWriteBehavior.NoCache; var client = new HttpClient(); client.DefaultRequestHeaders.Add("appGuid", appGuid.ToString()); client.DefaultRequestHeaders.Add("screenshotType", screenshotType.ToString()); client.DefaultRequestHeaders.Add("screenshotSize", screenshotSize.ToString()); client.DefaultRequestHeaders.Add("screenshotIndex", screenshotIndex.ToString()); var response = await client.GetAsync(ServerUri.GetScreenshotDownloadUri(appGuid, screenshotIndex, (ScreenshotType)screenshotType, (ScreenshotSize)screenshotSize)); var buffer = await response.Content.ReadAsBufferAsync().AsTask(); var image = await buffer.ToArray().ConvertToBitmapImageAsync(); return(new Screenshot() { AppGuid = appGuid, OriginalImage = screenshotSize == AppScreenshotSize.Original ? image : null, ThumbnailImage = screenshotSize == AppScreenshotSize.Thumbnail ? image : null, Index = screenshotIndex }); }
public async Task <Screenshot> GetAppScreenShotAsync(Guid appGuid, AppScreenshotType appScreenshotType, AppScreenshotSize appScreenshotSize, int screenShotIndex) { return(await HttpTransfer.GetAppScreenshotAsync( appGuid, appScreenshotType, appScreenshotSize, screenShotIndex)); }
public async Task <Screenshot> GetAppScreenShotAsync( Guid appGuid, AppScreenshotSize screenShotSize, AppScreenshotType screenShotType, int screenShotIndex) { var screenShotDC = await RemoteUserService.GetAppScreenshotAsync(new ScreenshotFilterDataContract() { AppGuid = appGuid, ScreenshotSize = (ScreenshotSize)screenShotSize, ScreenshotType = (ScreenshotType)screenShotType, ScreenshotIndex = screenShotIndex }); this.Close(); return(await screenShotDC.GetScreenShotAsync()); }