Exemplo n.º 1
0
        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,
            });
        }
Exemplo n.º 2
0
 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
     });
 }
Exemplo n.º 3
0
        /// <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);
        }
Exemplo n.º 4
0
 public Task <ScreenshotDataContract> GetAppScreenShotAsync(ScreenshotFilterDataContract filter)
 {
     throw new NotImplementedException();
 }
Exemplo n.º 5
0
 public Task <ObservableCollection <int> > GetScreenshotIdsAsync(ScreenshotFilterDataContract fitler)
 {
     throw new NotImplementedException();
 }
Exemplo n.º 6
0
 public List <int> GetScreenshotIds(ScreenshotFilterDataContract fitler)
 {
     return(AppDomainService.GetScreenshotIds(fitler));
 }
Exemplo n.º 7
0
 public ScreenshotDataContract GetScreenshot(ScreenshotFilterDataContract filter)
 {
     return(AppDomainService.GetScreenshot(filter));
 }
Exemplo n.º 8
0
 /// <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());
 }