Exemplo n.º 1
0
        /// <summary>
        /// Gets the cursos position.
        /// </summary>
        /// <returns></returns>
        public Coordinates GetCursorPosition()
        {
            var buffer = GetOutputBuffer();

            ConsoleHostNativeMethods.CONSOLE_SCREEN_BUFFER_INFO info = DotConsoleNative.GetConsoleScreenBufferInfo(buffer);

            return(new Coordinates(info.cursorPosition.X, info.cursorPosition.Y));
        }
Exemplo n.º 2
0
        /// <summary>
        /// Gets the output buffer windows as a rectangle.
        /// </summary>
        /// <returns></returns>
        public Region GetOutputBufferWindow()
        {
            var buffer = GetOutputBuffer();

            ConsoleHostNativeMethods.CONSOLE_SCREEN_BUFFER_INFO info = DotConsoleNative.GetConsoleScreenBufferInfo(buffer);

            return(new Region()
            {
                Left = info.window.Left, Top = info.window.Top, Height = info.window.Bottom, Width = info.window.Right
            });
        }
Exemplo n.º 3
0
        /// <summary>
        /// Gets the output buffer window size.
        /// </summary>
        /// <returns></returns>
        public Coordinates GetOutputBufferWindowSize()
        {
            var buffer = GetOutputBuffer();

            ConsoleHostNativeMethods.CONSOLE_SCREEN_BUFFER_INFO info = DotConsoleNative.GetConsoleScreenBufferInfo(buffer);

            return(new Coordinates()
            {
                X = info.size.X,
                Y = info.size.Y
            });
        }