private void HandleScreenshotRequest(OperationRequest operationRequest, SendParameters sendParameters)
        {
            var param   = ScreenshotRequest.Read(operationRequest.Parameters);
            var handler = new ScreenshotHandler();

            //launch client and make screens
            var metaInfoPathName = handler.RunClientAndWait(param.topicId, param.discussionId);

            var screenDict = handler.MetaInfoToDict(metaInfoPathName);

            File.Delete(metaInfoPathName);

            //build screenshot response
            var resp = new Dictionary <int, byte[]>();

            foreach (var kvp in screenDict)
            {
                resp.Add(kvp.Key, File.ReadAllBytes(kvp.Value));
            }

            this.SendOperationResponse(
                new OperationResponse((byte)DiscussionOpCode.ScreenshotRequest, ScreenshotResponse.Write(resp)),
                sendParameters);

            //cleanup
            foreach (var kvp in screenDict)
            {
                File.Delete(kvp.Value);
            }
        }
Beispiel #2
0
        private void HandleScreenshotRequest(OperationRequest operationRequest, SendParameters sendParameters)
        {
            var param = ScreenshotRequest.Read(operationRequest.Parameters);
            var handler = new ScreenshotHandler();

            //launch client and make screens
            var metaInfoPathName = handler.RunClientAndWait(param.topicId, param.discussionId);
       
            var screenDict = handler.MetaInfoToDict(metaInfoPathName);
            File.Delete(metaInfoPathName);

            //build screenshot response
            var resp = new Dictionary<int, byte[]>();
            foreach (var kvp in screenDict)
                resp.Add(kvp.Key, File.ReadAllBytes(kvp.Value));

            this.SendOperationResponse(
                new OperationResponse((byte) DiscussionOpCode.ScreenshotRequest, ScreenshotResponse.Write(resp)),
                sendParameters);

            //cleanup
            foreach (var kvp in screenDict)
                File.Delete(kvp.Value);
        }