Example #1
0
		public void PushScreenUpdate(byte[] data)
		{
			if (data != null)
			{
				// Unpack the data.
				//
				Image partial;
				Rectangle bounds;
				Guid id;
				Utils.UnpackScreenCaptureData(data, out partial, out bounds, out id);

				// Update the current screen
				//
				ViewerSession viewSession;
				if (!_sessions.ContainsKey(id))
				{
					// Create a new session.
					//
					viewSession = new ViewerSession {Id = id};
					_sessions[id] = viewSession;
				}
				else
				{
					viewSession = _sessions[id];
				}
				Utils.UpdateScreen(ref viewSession.Screen, partial, bounds);

				UpdateScreenImage(id);
			}
		}
Example #2
0
		public string PushCursorUpdate(byte[] data)
		{
			if (data != null)
			{
				// Unpack the data.
				//
				Image cursor;
				int cursorX, cursorY;
				Guid id;
				Utils.UnpackCursorCaptureData(data, out cursor, out cursorX, out cursorY, out id);

				// Update the current screen
				//
				ViewerSession viewSession;
				if (!_sessions.ContainsKey(id))
				{
					// Create a new session.
					//
					viewSession = new ViewerSession {Id = id};
					_sessions[id] = viewSession;
				}
				else
				{
					viewSession = _sessions[id];
				}
				viewSession.Cursor = cursor;
				viewSession.CursorX = cursorX;
				viewSession.CursorY = cursorY;
				UpdateScreenImage(id);
			}

			return Commands.SerializeCommandStack();
		}