Beispiel #1
0
        /// <summary>
        /// Initializes class and sets defaults.
        /// </summary>
        internal AnsiEscape(IpmiSerialClient sc, SerialConsoleType consoleType)
        {
            // Clear the Console
            Console.Clear();

            // set console and buffer size
            base.SetConsoleSize(80, 25);
            base.SetConsoleBufferSize(80, 25);

            // Ipmi Client
            this.IpmiClient = sc;

            // Set the Console Type
            this.consoleType = consoleType;

            // set cursor positions to begining
            PositionLeft = 0;
            PositionTop = 0;

            // set cursor position to default
            base.SetCursorPosition(PositionLeft, PositionTop);

            // capture current code page.
            uint cp = NativeMethods.GetCodePage();
            if (cp > 0)
                codepage = cp;

            // Set the Console Code page to 437
            NativeMethods.SetCodePage(437);

            // pInvoke Call to Disable Console
            // wordwrap.  By default VT100 does not
            // expect wordwarp
            NativeMethods.DisableWordWrap(); // Disable Word Wrap

            // Capture Ctrl+C as key command.
            Console.TreatControlCAsInput = true;

            // enable receive loop.
            SharedFunc.SetSerialSession(true);
        }
Beispiel #2
0
        ///// <summary>
        ///// Flag for Console Read while loop
        ///// </summary>
        //internal volatile bool threadRun = false;
        /// <summary>
        /// Initializes class and sets defaults.
        /// </summary>
        internal AnsiEscape(IpmiSerialClient sc)
        {
            // set console and buffer size
            base.SetConsoleSize(80, 25);
            base.SetConsoleBufferSize(80, 25);
            // Ipmi Client.
            this.ipmiClient = sc;
            // set cursor positions to begining
            PositionLeft = 0;
            PositionTop = 0;
            // set cursor position to default
            base.SetCursorPosition(PositionLeft, PositionTop);

            // Set the Console Code page to 437
            NativeMethods.SetCodePage();
            // pInvoke Call to Disable Console
            // wordwrap.  By default VT100 does not
            // expect wordwarp
            NativeMethods.DisableWordWrap(); // Disable Word Wrap
            Console.TreatControlCAsInput = true;
        }