PowerArgs.Cli.ConsoleBitmap.DrawPixel C# (CSharp) Method

DrawPixel() private method

private DrawPixel ( int x, int y, ConsolePixel pixel, ConsoleCharacter value ) : void
x int
y int
pixel ConsolePixel
value ConsoleCharacter
return void
        private void DrawPixel(int x, int y, ConsolePixel pixel, ConsoleCharacter value)
        {
            x = Left + x;
            y = Top + y;

            if(x >= lastBufferWidth)
            {
                return;
            }
            try
            {
                if (Console.CursorLeft != x)
                {
                    Console.CursorLeft = x;
                }

                if (Console.CursorTop != y)
                {
                    Console.CursorTop = y;
                }

                if (Console.ForegroundColor != value.ForegroundColor)
                {
                    Console.ForegroundColor = value.ForegroundColor;
                }

                if (Console.BackgroundColor != value.BackgroundColor)
                {
                    Console.BackgroundColor = value.BackgroundColor;
                }

                Console.Write(value.Value);
            }catch(ArgumentOutOfRangeException)
            {

            }

            if(pixel != null)
            {
                pixel.Sync();
            }
        }