static Console() { colorStore = GetColorStore(); colorManagerFactory = new ColorManagerFactory(); colorManager = colorManagerFactory.GetManager(colorStore, MAX_COLOR_CHANGES, INITIAL_COLOR_CHANGE_COUNT_VALUE); System.Console.CancelKeyPress += Console_CancelKeyPress; }
private static void ReplaceAllColorsWithDefaults(bool isInCompatibilityMode) { colorStore = GetColorStore(); colorManagerFactory = new ColorManagerFactory(); colorManager = colorManagerFactory.GetManager(colorStore, MAX_COLOR_CHANGES, INITIAL_COLOR_CHANGE_COUNT_VALUE, isInCompatibilityMode); // There's no need to do this if in compatibility mode, as more than 16 colors won't be used, anyway. if (!colorManager.IsInCompatibilityMode) { new ColorMapper().SetBatchBufferColors(defaultColorMap); } }
public static void ReplaceAllColorsWithDefaults() { colorStore = GetColorStore(); colorManagerFactory = new ColorManagerFactory(); // Below, we access a property of the colorManager. We assume that it has already been instantiated, since it gets instantiated in // this class's static ctor. colorManager = colorManagerFactory.GetManager(colorStore, MAX_COLOR_CHANGES, INITIAL_COLOR_CHANGE_COUNT_VALUE, colorManager.IsInCompatibilityMode); // There's no need to do this if in compatibility mode, as more than 16 colors won't be used, anyway. if (!colorManager.IsInCompatibilityMode) { new ColorMapper().SetBatchBufferColors(defaultColorMap); } }