Exemplo n.º 1
0
        private static void SaveAndUpload(Stream image)
        {
            string name = DateTime.Now.ToString("yyyyMMddHHmmss") + "-push.png";

            // SAVE DISK
            if (settings.DoSaveToDisk)
            {
                ic.Save(image, settings.ImagePath, name);
            }

            // SAVE ONLINE
            isp.Upload(image, name);
        }
        private void SaveScreenshot(object state)
        {
            IImageCreator imageCreator = state as IImageCreator;

            if (imageCreator == null)
            {
                return;
            }

            try
            {
                lock (_screenshotsSyncRoot)
                {
                    imageCreator.Save(GetNewScreenshotName());
                }
            }
            catch (Exception e)
            {
                TraceSink.GetTraceSink().TraceError(string.Format("Error saving a screenshot: {0}", e));
            }
        }