public ConsoleSizeWatcher()
        {
            this.threadArgs = new ConsoleSizeWatcherThreadArguments();

            this.formerWindowHeight = Console.WindowHeight;
            this.formerWindowWidth  = Console.WindowWidth;

            this.formerBufferHeight = Console.BufferHeight;
            this.formerBufferWidth  = Console.BufferWidth;
        }
        private void Worker(object data)
        {
            if (!(data is ConsoleSizeWatcherThreadArguments))
            {
                throw new ArgumentOutOfRangeException(nameof(data), $"The specified data must be an instance of the {nameof(ConsoleSizeWatcherThreadArguments)} class");
            }

            ConsoleSizeWatcherThreadArguments args = (ConsoleSizeWatcherThreadArguments)data;

            while (!args.Exit)
            {
                if (Console.WindowHeight != neededHeight || Console.WindowWidth != neededWidth)
                {
                    Console.Clear();
                    try
                    {
                        if (Console.BufferWidth > neededWidth)
                        {
                            Console.WindowWidth = neededWidth;
                            Console.BufferWidth = neededWidth;
                        }
                        else
                        {
                            Console.BufferWidth = neededWidth;
                            Console.WindowWidth = neededWidth;
                        }
                        if (Console.BufferHeight > neededHeight)
                        {
                            Console.WindowHeight = neededHeight;
                            Console.BufferHeight = neededHeight;
                        }
                        else
                        {
                            Console.BufferHeight = neededHeight;
                            Console.WindowHeight = neededHeight;
                        }
                        this.FireOnSizeChanged(new OnSizeChangedEventArgs());
                    }
                    catch
                    {
                        Console.Clear();
                        Console.Write("An error occured after changing the console size. Please resize the window to continue!");
                    }
                }

                Thread.Sleep(800);
            }
        }