コード例 #1
0
ファイル: ConsoleClient.cs プロジェクト: stangelandcl/Actors
 private static bool IsSameSize(Screen value)
 {
     return Console.BufferWidth == value.Width &&
         Console.BufferHeight == value.Height &&
         Console.WindowWidth == value.Width &&
         Console.WindowHeight == value.Height;
 }
コード例 #2
0
        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();
        }
コード例 #3
0
 void ScreenUpdate(IMail m, Screen screen, CursorPosition position)
 {
     console.Screen = screen;
     console.CursorPosition = position;
     remote = m.As<RpcMail>().From.As<ActorId>();
 }