/** * Adds an <CODE>Object</CODE> to the <CODE>List</CODE>. * * @param o the object to add. * @return true if adding the object succeeded */ public override bool Add(IElement o) { if (o is ListItem) { ListItem item = (ListItem)o; Chunk chunk = new Chunk(preSymbol, symbol.Font); chunk.Attributes = symbol.Attributes; chunk.Append(GreekAlphabetFactory.GetString(first + list.Count, lowercase)); chunk.Append(postSymbol); item.ListSymbol = chunk; item.SetIndentationLeft(symbolIndent, autoindent); item.IndentationRight = 0; list.Add(item); return(true); } else if (o is List) { List nested = (List)o; nested.IndentationLeft = nested.IndentationLeft + symbolIndent; first--; list.Add(nested); return(true); } return(false); }
/// <summary> /// Adds an Object to the List . /// </summary> /// <param name="o">the object to add.</param> /// <returns>true if adding the object succeeded</returns> public override bool Add(object o) { if (o is ListItem) { var item = (ListItem)o; var chunk = new Chunk(preSymbol, symbol.Font); chunk.Append(GreekAlphabetFactory.GetString(first + list.Count, lowercase)); chunk.Append(postSymbol); item.ListSymbol = chunk; item.SetIndentationLeft(symbolIndent, autoindent); item.IndentationRight = 0; list.Add(item); return(true); } else if (o is List) { var nested = (List)o; nested.IndentationLeft = nested.IndentationLeft + symbolIndent; first--; list.Add(nested); return(true); } else if (o is string) { return(Add(new ListItem((string)o))); } return(false); }