public void Initialize(DotConsoleRegion parent) { bufferSize = new Coordinates(parent.Options.BufferSize.X, 3); RegionCreationOptions init = new RegionCreationOptions(parent.Renderer, parent, bufferSize); init.Orgin = new Coordinates(0, 1); init.Position = DotConsoleRegion.ContentPosition.Top; progressBarRegion = new DotConsoleRegion(init); }
public DotConsoleRegion(RegionCreationOptions config) { Options = config; this.contentBuffer = new CellBuffer(Options.BufferSize.Y, Options.BufferSize.X); this.InputLoop = new DotConsoleInputLoop(this); if (Options.ForegroundColor.Equals(default(Color))) { Options.ForegroundColor = new Color(255, 255, 255); } if (Options.Parent != null) { this.parent = config.Parent; this.parent.RegisterRegion(this); } }
private void Initialize() { renderer = new DotConsoleRenderer(); //Set encoding. Console.OutputEncoding = System.Text.Encoding.Unicode; //Create the main content region. //This might not be the efficient way since content regions are extremly expensive so this may change. var size = renderer.GetOutputBufferWindowSize(); var options = new RegionCreationOptions(renderer, null, size); options.WillScrollContent = true; main = new DotConsoleRegion(options); this.BackgroundColor = main.Options.BackgroundColor; this.ForegroundColor = main.Options.ForegroundColor; Console.CursorVisible = true; Controls = new List <IConsoleControl>(); }