Beispiel #1
0
        /// <summary>
        /// Do the repaint of the telnet session.
        /// </summary>
        /// <param name="telnet">which telnet session to repaint</param>
        /// <param name="fullSync">if true, then ignore the diffing algorithm and just redraw everything.</param>
        internal void RepaintTelnet(TelnetSingletonServer telnet, bool fullSync)
        {
            if (fullSync || prevTelnetScreens[telnet] == null)
            {
                RepaintTelnetFull(telnet);
                return;
            }

            // If the state of the screen reverse, or the visual bell flags, has changed since last time,
            // spit out the characters to change the state:
            if (telnet.ReverseScreen != shared.Screen.ReverseScreen)
            {
                telnet.Write(shared.Screen.ReverseScreen ? ((char)UnicodeCommand.REVERSESCREENMODE) : ((char)UnicodeCommand.NORMALSCREENMODE));
                telnet.ReverseScreen = shared.Screen.ReverseScreen;
            }
            if (telnet.VisualBeep != shared.Screen.VisualBeep)
            {
                telnet.Write(shared.Screen.VisualBeep ? ((char)UnicodeCommand.VISUALBEEPMODE) : ((char)UnicodeCommand.AUDIOBEEPMODE));
                telnet.VisualBeep = shared.Screen.VisualBeep;
            }
            string updateText = mostRecentScreen.DiffFrom(prevTelnetScreens[telnet]);

            telnet.Write(updateText);

            prevTelnetScreens[telnet] = mostRecentScreen.DeepCopy();
            for (int i = 0; i < shared.Screen.BeepsPending; ++i)
            {
                telnet.Write((char)UnicodeCommand.BEEP); // The terminal's UnicodeMapper will convert this to ascii 0x07 if the right terminal type.
            }
        }
Beispiel #2
0
        /// <summary>
        /// Do the repaint of the telnet session.
        /// </summary>
        /// <param name="telnet">which telnet session to repaint</param>
        /// <param name="fullSync">if true, then ignore the diffing algorithm and just redraw everything.</param>
        internal void RepaintTelnet(TelnetSingletonServer telnet, bool fullSync)
        {
            if (fullSync || prevTelnetScreens[telnet] == null)
            {
                RepaintTelnetFull(telnet);
                return;
            }

            string updateText = mostRecentScreen.DiffFrom(prevTelnetScreens[telnet]);

            telnet.Write(updateText);

            prevTelnetScreens[telnet] = mostRecentScreen.DeepCopy();
        }