/// <summary> /// Excutes the Command /// </summary> public override void Execute() { WorksheetWriter.MoveTo("A1"); WorksheetWriter.WriteRow(header); WriteItems(hierarchy.Enterprise, 1); }
/// <summary> /// Writes the items. /// </summary> /// <param name="item">The item.</param> /// <param name="depth">The depth.</param> private void WriteItems(IItem item, int depth) { List <string> row = new List <string> { Convert.ToString(depth), item.GetType().Name, string.Empty }; for (int i = 1; i < depth; i++) { row.Add(string.Empty); } row.Add(item.Name); WorksheetWriter.WriteRow(row); foreach (IItem child in item.GetItems()) { WriteItems(child, depth + 1); } }