/// <summary> /// Changes the view types. /// </summary> /// <param name="layoutType">Type of the layout.</param> /// <param name="customColours">The custom colours.</param> /// <param name="customTextColours">The custom text colours.</param> /// <param name="noCustomColours">The no custom colours.</param> /// <param name="normal">The normal.</param> private static void ChangeViewTypes(ViewLayoutType layoutType, ToolStripMenuItem customColours, ToolStripMenuItem customTextColours, ToolStripMenuItem noCustomColours, ToolStripMenuItem normal) { switch (layoutType) { case ViewLayoutType.CUSTOMCOLOURVIEW: customColours.Checked = true; customTextColours.Checked = false; noCustomColours.Checked = false; normal.Checked = false; break; case ViewLayoutType.CUSTOMTEXTCOLOURVIEW: customColours.Checked = false; customTextColours.Checked = true; noCustomColours.Checked = false; normal.Checked = false; break; case ViewLayoutType.NORMALVIEW: customColours.Checked = false; customTextColours.Checked = false; noCustomColours.Checked = false; normal.Checked = true; break; case ViewLayoutType.NOCUSTOMCOLOURS: customColours.Checked = false; customTextColours.Checked = false; noCustomColours.Checked = true; normal.Checked = false; break; } }
public View(string title = "", List <string> textA = null, List <string> textB = null, List <string> textC = null, List <string> textD = null, ViewLayoutType viewLayoutType = ViewLayoutType.twoStackOneLong, int width = 100, int height = 30, Display display = null) { textA = textA ?? new List <string>(); textB = textB ?? new List <string>(); textC = textC ?? new List <string>(); textD = textD ?? new List <string>(); if (display != null) { this.display = display; } type = viewLayoutType; Title = title; this.width = width; this.height = height; if (viewLayoutType == ViewLayoutType.twoStackOneLong) { //+--------Title---------------- + //+-----------------------------+ //| | | //| areaA | | //| | | //| | areaB | //+---------------+ | //| | | //| areaC | | //| | | //+---------------+-------------+ //+--------------Command-------- + int sixtyWidth = (int)Math.Ceiling(0.6 * width); int fortyWidth = (int)Math.Ceiling(0.4 * width); int fiftyHeight = (int)Math.Ceiling(0.5 * height); AreaA = new WindowArea(sixtyWidth, fiftyHeight, textA, ConsoleColor.White, ConsoleColor.DarkGreen); AreaB = new WindowArea(fortyWidth, height, textB, ConsoleColor.White, ConsoleColor.DarkBlue); AreaC = new WindowArea(sixtyWidth, fiftyHeight, textC, ConsoleColor.White, ConsoleColor.Black); } if (viewLayoutType == ViewLayoutType.singleView || viewLayoutType == ViewLayoutType.drawOnSingleView) { AreaA = new WindowArea(width, height, textA, ConsoleColor.White, ConsoleColor.DarkGreen); } }