Ejemplo n.º 1
0
        void TakeScreenshot(Action readyAppForScreenshot, string deviceName)
        {
            readyAppForScreenshot();
            if (!SaveScreenshots)
            {
                return;
            }

            ++screenshotIndex;
            var screenshotFile      = App.Screenshot("temp");
            var filename            = screenshotIndex + " " + deviceName + Path.GetExtension(screenshotFile.FullName);
            var destinationFileName = Path.Combine(screenshotsDirectory.FullName, filename);

            screenshotFile.MoveTo(destinationFileName);
            if (OptimizeImagesAfterSave)
            {
                ImageOptimizer.OptimizeImage(destinationFileName);
            }
        }