private static bool IsSameSize(Screen value) { return Console.BufferWidth == value.Width && Console.BufferHeight == value.Height && Console.WindowWidth == value.Width && Console.WindowHeight == value.Height; }
void Snapshot() { if (!process.IsAlive) { Die("Process terminated"); return; } ActorId[] a; lock (actors) a = actors.ToArray(); var screen = process.Console.Screen; var now = DateTime.Now; if (lastScreen == null || !lastScreen.Equals(screen) || now - lastUpdate > TimeSpan.FromSeconds(5)) { lastUpdate = now; lastScreen = screen; foreach (var actor in a) Node.Send(actor, Id, "ScreenUpdate", screen, process.Console.CursorPosition); } Loop(); }
void ScreenUpdate(IMail m, Screen screen, CursorPosition position) { console.Screen = screen; console.CursorPosition = position; remote = m.As<RpcMail>().From.As<ActorId>(); }