refactor: Rename ConsoleTableRow and ConsoleTableColumn to ConsoleDisplayTableRow and ConsoleDisplayTableColumn
parent
059a1e90b9
commit
8f88c17df9
|
@ -48,12 +48,12 @@ namespace OpenSim.Framework.Console
|
||||||
/// <summary>
|
/// <summary>
|
||||||
/// Table columns.
|
/// Table columns.
|
||||||
/// </summary>
|
/// </summary>
|
||||||
public List<ConsoleTableColumn> Columns { get; private set; }
|
public List<ConsoleDisplayTableColumn> Columns { get; private set; }
|
||||||
|
|
||||||
/// <summary>
|
/// <summary>
|
||||||
/// Table rows
|
/// Table rows
|
||||||
/// </summary>
|
/// </summary>
|
||||||
public List<ConsoleTableRow> Rows { get; private set; }
|
public List<ConsoleDisplayTableRow> Rows { get; private set; }
|
||||||
|
|
||||||
/// <summary>
|
/// <summary>
|
||||||
/// Number of spaces to indent the table.
|
/// Number of spaces to indent the table.
|
||||||
|
@ -68,8 +68,8 @@ namespace OpenSim.Framework.Console
|
||||||
public ConsoleDisplayTable()
|
public ConsoleDisplayTable()
|
||||||
{
|
{
|
||||||
TableSpacing = DefaultTableSpacing;
|
TableSpacing = DefaultTableSpacing;
|
||||||
Columns = new List<ConsoleTableColumn>();
|
Columns = new List<ConsoleDisplayTableColumn>();
|
||||||
Rows = new List<ConsoleTableRow>();
|
Rows = new List<ConsoleDisplayTableRow>();
|
||||||
}
|
}
|
||||||
|
|
||||||
public override string ToString()
|
public override string ToString()
|
||||||
|
@ -88,7 +88,7 @@ namespace OpenSim.Framework.Console
|
||||||
sb.AppendFormat(formatString, Columns.ConvertAll(c => c.Header).ToArray());
|
sb.AppendFormat(formatString, Columns.ConvertAll(c => c.Header).ToArray());
|
||||||
|
|
||||||
// rows
|
// rows
|
||||||
foreach (ConsoleTableRow row in Rows)
|
foreach (ConsoleDisplayTableRow row in Rows)
|
||||||
sb.AppendFormat(formatString, row.Cells.ToArray());
|
sb.AppendFormat(formatString, row.Cells.ToArray());
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -115,23 +115,23 @@ namespace OpenSim.Framework.Console
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
public struct ConsoleTableColumn
|
public struct ConsoleDisplayTableColumn
|
||||||
{
|
{
|
||||||
public string Header { get; set; }
|
public string Header { get; set; }
|
||||||
public int Width { get; set; }
|
public int Width { get; set; }
|
||||||
|
|
||||||
public ConsoleTableColumn(string header, int width) : this()
|
public ConsoleDisplayTableColumn(string header, int width) : this()
|
||||||
{
|
{
|
||||||
Header = header;
|
Header = header;
|
||||||
Width = width;
|
Width = width;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
public struct ConsoleTableRow
|
public struct ConsoleDisplayTableRow
|
||||||
{
|
{
|
||||||
public List<string> Cells { get; private set; }
|
public List<string> Cells { get; private set; }
|
||||||
|
|
||||||
public ConsoleTableRow(List<string> cells) : this()
|
public ConsoleDisplayTableRow(List<string> cells) : this()
|
||||||
{
|
{
|
||||||
Cells = cells;
|
Cells = cells;
|
||||||
}
|
}
|
||||||
|
|
|
@ -146,11 +146,11 @@ namespace OpenSim.Region.OptionalModules.Avatar.Attachments
|
||||||
sb.AppendFormat("Attachments for {0}\n", sp.Name);
|
sb.AppendFormat("Attachments for {0}\n", sp.Name);
|
||||||
|
|
||||||
ConsoleDisplayTable ct = new ConsoleDisplayTable() { Indent = 2 };
|
ConsoleDisplayTable ct = new ConsoleDisplayTable() { Indent = 2 };
|
||||||
ct.Columns.Add(new ConsoleTableColumn("Attachment Name", 36));
|
ct.Columns.Add(new ConsoleDisplayTableColumn("Attachment Name", 36));
|
||||||
ct.Columns.Add(new ConsoleTableColumn("Local ID", 10));
|
ct.Columns.Add(new ConsoleDisplayTableColumn("Local ID", 10));
|
||||||
ct.Columns.Add(new ConsoleTableColumn("Item ID", 36));
|
ct.Columns.Add(new ConsoleDisplayTableColumn("Item ID", 36));
|
||||||
ct.Columns.Add(new ConsoleTableColumn("Attach Point", 14));
|
ct.Columns.Add(new ConsoleDisplayTableColumn("Attach Point", 14));
|
||||||
ct.Columns.Add(new ConsoleTableColumn("Position", 15));
|
ct.Columns.Add(new ConsoleDisplayTableColumn("Position", 15));
|
||||||
|
|
||||||
// sb.AppendFormat(
|
// sb.AppendFormat(
|
||||||
// " {0,-36} {1,-10} {2,-36} {3,-14} {4,-15}\n",
|
// " {0,-36} {1,-10} {2,-36} {3,-14} {4,-15}\n",
|
||||||
|
@ -176,7 +176,7 @@ namespace OpenSim.Region.OptionalModules.Avatar.Attachments
|
||||||
// attachmentObject.Name, attachmentObject.LocalId, attachmentObject.FromItemID,
|
// attachmentObject.Name, attachmentObject.LocalId, attachmentObject.FromItemID,
|
||||||
// (AttachmentPoint)attachmentObject.AttachmentPoint, attachmentObject.RootPart.AttachedPos);
|
// (AttachmentPoint)attachmentObject.AttachmentPoint, attachmentObject.RootPart.AttachedPos);
|
||||||
ct.Rows.Add(
|
ct.Rows.Add(
|
||||||
new ConsoleTableRow(
|
new ConsoleDisplayTableRow(
|
||||||
new List<string>()
|
new List<string>()
|
||||||
{
|
{
|
||||||
attachmentObject.Name,
|
attachmentObject.Name,
|
||||||
|
|
Loading…
Reference in New Issue