public ScreenshotDataContract GetAppScreenshot(ScreenshotFilterDataContract filter) { var bytes = AppBiz.GetAppScreenshot(filter.AppGuid, filter.ScreenshotType, filter.ScreenshotSize, filter.ScreenshotIndex); return(new ScreenshotDataContract() { Original = filter.ScreenshotSize == ScreenshotSize.Original ? bytes : null, Thumbnail = filter.ScreenshotSize == ScreenshotSize.Thumbnail ? bytes : null, }); }
public static AppScreenshotFilter ToAppScreenshotFilter(this ScreenshotFilterDataContract screenShotFilterDataContract) { return(new AppScreenshotFilter() { AppId = screenShotFilterDataContract.AppId, AppGuid = screenShotFilterDataContract.AppGuid, ScreenshotType = screenShotFilterDataContract.ScreenshotType, ScreenshotSize = screenShotFilterDataContract.ScreenshotSize, ScreenshotId = screenShotFilterDataContract.ScreenshotId }); }
/// <summary> /// needs screenshotId , screenshotSize parameters /// </summary> /// <param name="filter"></param> /// <returns>Screenshot</returns> public ScreenshotDataContract GetScreenshot(ScreenshotFilterDataContract filter) { var appScreenshot = ScreenshotBiz.Single(s => s.Id == filter.ScreenshotId, s => s.App); var path = GetScreenshotPath(appScreenshot.App.Guid, appScreenshot.FileName, filter.ScreenshotSize); var appScreenshotDataContract = appScreenshot.ToScreenshotDataContract(); // load screenshot file var bytes = File.ReadAllBytes(path); appScreenshotDataContract.Original = filter.ScreenshotSize == ScreenshotSize.Original ? bytes : null; appScreenshotDataContract.Thumbnail = filter.ScreenshotSize == ScreenshotSize.Thumbnail ? bytes : null; return(appScreenshotDataContract); }
public Task <ScreenshotDataContract> GetAppScreenShotAsync(ScreenshotFilterDataContract filter) { throw new NotImplementedException(); }
public Task <ObservableCollection <int> > GetScreenshotIdsAsync(ScreenshotFilterDataContract fitler) { throw new NotImplementedException(); }
public List <int> GetScreenshotIds(ScreenshotFilterDataContract fitler) { return(AppDomainService.GetScreenshotIds(fitler)); }
public ScreenshotDataContract GetScreenshot(ScreenshotFilterDataContract filter) { return(AppDomainService.GetScreenshot(filter)); }
/// <summary> /// need appId and screenshotType paramteres /// </summary> /// <param name="filter"></param> /// <returns>screenshot ids list</returns> public List <int> GetScreenshotIds(ScreenshotFilterDataContract filter) { return(ScreenshotBiz.Where(s => s.AppId == filter.AppId && s.Type == filter.ScreenshotType).Select(sc => sc.Id).ToList()); }