예제 #1
0
        public static ShellTextStyler Set(ShellTextStyle style)
        {
            if (style == ShellTextStyle.None)
            {
                throw new ArgumentOutOfRangeException(nameof(style));
            }

            var styler = new ShellTextStyler(style, _currentStyle);

            _currentStyle = style;
            SetCore(style, true);
            return(styler);
        }
예제 #2
0
        public static void Initialize(ShellOptions options)
        {
            if (IsInitialized)
            {
                return;
            }
            IsInitialized = true;

            Options = options;

            Console.OutputEncoding = Options.Encoding;

            ShellColorizer.Initialize(Options.DefaultForegroundColor, Options.DefaultBackgroundColor);
            ShellTextStyler.Initialize();
        }