Add much easier ConsoleDisplayTable AddColumn() and AddRow() methods.

Use these for new "show regions" command rather than old cumbersome stuff.
This commit is contained in:
Justin Clark-Casey (justincc)
2012-06-26 00:40:46 +01:00
parent 5292b8b8be
commit 1f22b29ca3
2 changed files with 20 additions and 6 deletions

View File

@@ -79,6 +79,16 @@ namespace OpenSim.Framework.Console
return sb.ToString();
}
public void AddColumn(string name, int width)
{
Columns.Add(new ConsoleDisplayTableColumn(name, width));
}
public void AddRow(params string[] cells)
{
Rows.Add(new ConsoleDisplayTableRow(cells));
}
public void AddToStringBuilder(StringBuilder sb)
{
string formatString = GetFormatString();
@@ -135,5 +145,10 @@ namespace OpenSim.Framework.Console
{
Cells = cells;
}
public ConsoleDisplayTableRow(params string[] cells) : this()
{
Cells = new List<string>(cells);
}
}
}