/// <summary> /// The screenshot could not be taken. Inform clients. /// </summary> /// <param name="error"></param> private static void ImageHelperScreenshotFailed(ImageHelperError error) { foreach (var pair in _socketsWaitingForScreenshot) { SendScreenshotToClient(pair.Key, pair.Value, error); } _socketsWaitingForScreenshot = null; }
/// <summary> /// Send the current screenshot to the client as byte array /// </summary> private static void SendScreenshotToClient(AsyncSocket sender, int width, ImageHelperError error) { MessageScreenshot screenshot = new MessageScreenshot(); if (error != null) { screenshot.Error = error; } else { screenshot.Screenshot = _imageHelper.resizedScreenshot(width); } SendMessageToClient.Send(screenshot, sender); }