Example #1
0
        public ColorManager GetManager(ConcurrentDictionary <Color, ConsoleColor> colorMap, ConcurrentDictionary <ConsoleColor, Color> consoleColorMap, int maxColorChanges, int initialColorChangeCountValue, bool isInCompatibilityMode)
        {
            ColorStore  colorStore  = new ColorStore(colorMap, consoleColorMap);
            ColorMapper colorMapper = GetColorMapperSafe(ColorManager.IsWindows());

            return(new ColorManager(colorStore, colorMapper, maxColorChanges, initialColorChangeCountValue, isInCompatibilityMode));
        }
Example #2
0
        static Console()
        {
            isInCompatibilityMode = false;
            isWindows             = ColorManager.IsWindows();
            try
            {
                if (isWindows)
                {
                    defaultColorMap = new ColorMapper().GetBufferColors();
                }
            }
            catch (ConsoleAccessException ex)
            {
                isInCompatibilityMode = true;
            }

            ReplaceAllColorsWithDefaults();
            System.Console.CancelKeyPress += Console_CancelKeyPress;
        }
Example #3
0
        public ColorManager GetManager(ColorStore colorStore, int maxColorChanges, int initialColorChangeCountValue, bool isInCompatibilityMode)
        {
            ColorMapper colorMapper = GetColorMapperSafe(ColorManager.IsWindows());

            return(new ColorManager(colorStore, colorMapper, maxColorChanges, initialColorChangeCountValue, isInCompatibilityMode));
        }