diff --git a/.gitignore b/.gitignore new file mode 100644 index 0000000..ddbeb91 --- /dev/null +++ b/.gitignore @@ -0,0 +1,6 @@ +.vscode +.bin +TerminalGui.csproj +Program.cs +bin +obj \ No newline at end of file diff --git a/section.cs b/section.cs index f07b43d..0c9bbe0 100644 --- a/section.cs +++ b/section.cs @@ -3,6 +3,7 @@ using System; namespace sections { public class Section { + string _name; int _x; int _y; int _padding; @@ -14,6 +15,7 @@ public class Section { string _value; public Section(){ + _name = nameof(this); _x = 0; _y = 0; _padding = 2; @@ -23,6 +25,7 @@ public class Section { _toTop = null; } public Section (int x, int y, int padding = 2) { + _name = nameof(this); _x = x; _y = y; _value = "This value was not set."; @@ -89,23 +92,13 @@ public class Section { _y = value; } } - - - - public string Value { - get { - return _value; - } set { - _value = value; - } - } private string[] Output { get { string[] outputString; string buffer = ""; bool isMultiLine = false; - int colsFromAllowedEdge = (int)((Console.WindowWidth - X - _padding)/2); + int colsFromAllowedEdge = Console.WindowWidth - X - _padding; for (int i = 0; i < _value.Length; i++) { if (i < 0 && colsFromAllowedEdge % i == 0) { buffer += '|'; diff --git a/window.cs b/window.cs index 20376cd..f670f37 100644 --- a/window.cs +++ b/window.cs @@ -7,7 +7,7 @@ namespace window public class Display { - Dictionary sectionList; + Dictionary sectionList; public Display () { @@ -15,7 +15,10 @@ namespace window } public void AddSection(Section section) { - sectionList.Add(sectionList.Count,section); + sectionList.Add(section._name,section); + } + public Section GetSection (string sectionName) { + } public void Present() {