/// <summary> /// Adds a TabStop object to the collection and sets its leader. /// </summary> public TabStop AddTabStop(Unit position, TabLeader leader) { TabStop tab = AddTabStop(position); tab.Leader = leader; return(tab); }
/// <summary> /// Adds a TabStop object to the collection and sets its alignment. /// </summary> public TabStop AddTabStop(Unit position, TabAlignment alignment) { TabStop tab = AddTabStop(position); tab.Alignment = alignment; return(tab); }
/// <summary> /// Adds a TabStop object to the collection. If a TabStop with the same position /// already exists, it is replaced by the new TabStop. /// </summary> public TabStop AddTabStop(TabStop tabStop) { if (tabStop == null) { throw new ArgumentNullException("tabStop"); } if (TabStopExists(tabStop.Position)) { int index = IndexOf(GetTabStopAt(tabStop.Position)); RemoveObjectAt(index); InsertObject(index, tabStop); } else { int count = Count; for (int index = 0; index < count; index++) { if (tabStop.Position.Point < ((TabStop)this[index]).Position.Point) { InsertObject(index, tabStop); return(tabStop); } } Add(tabStop); } return(tabStop); }
/// <summary> /// Adds a TabStop object to the collection and sets its alignment and leader. /// </summary> public TabStop AddTabStop(Unit position, TabAlignment alignment, TabLeader leader) { TabStop tab = AddTabStop(position); tab.Alignment = alignment; tab.Leader = leader; return(tab); }
/// <summary> /// Adds a TabStop object at the specified position to the collection. If a TabStop with the /// same position already exists, it is replaced by the new TabStop. /// </summary> public TabStop AddTabStop(Unit position) { if (TabStopExists(position)) { return(GetTabStopAt(position)); } TabStop tab = new TabStop(position); return(AddTabStop(tab)); }
/// <summary> /// Gets a TabStop by its position. /// Note that also Removed TabStops are taken into account. /// </summary> public TabStop GetTabStopAt(Unit position) { int count = Count; for (int index = 0; index < count; index++) { TabStop tabStop = (TabStop)this[index]; if (Math.Abs(tabStop.Position.Point - position.Point) < TabStopPrecision) { return(tabStop); } } return(null); }
/// <summary> /// Converts TabStops into DDL. /// </summary> public override void Serialize(Serializer serializer) { if (_fClearAll) { serializer.WriteLine("TabStops = null"); } int count = Count; for (int index = 0; index < count; index++) { TabStop tabstop = this[index]; tabstop.Serialize(serializer); } }
internal override void Serialize(XmlSerializer serializer) { serializer.WriteStartElement("TabStops"); if (_fClearAll) { //serializer.WriteLine("TabStops = null"); serializer.WriteSimpleAttribute("Clear", true); } int count = Count; for (int index = 0; index < count; index++) { TabStop tabstop = this[index]; tabstop.Serialize(serializer); } serializer.WriteEndElement(); }
/// <summary> /// Adds a TabStop object to the collection marked to remove the tab stop at /// the given position. /// </summary> public void RemoveTabStop(Unit position) { TabStop tab = AddTabStop(position); tab.AddTab = false; }
/// <summary> /// Adds a TabStop object to the collection. /// </summary> public void Add(TabStop tabStop) { TabStops.AddTabStop(tabStop); }
/// <summary> /// Adds a TabStop object at the specified position to the collection. If a TabStop with the /// same position already exists, it is replaced by the new TabStop. /// </summary> public TabStop AddTabStop(Unit position) { if (TabStopExists(position)) return GetTabStopAt(position); TabStop tab = new TabStop(position); return AddTabStop(tab); }
/// <summary> /// Adds a TabStop object to the collection. If a TabStop with the same position /// already exists, it is replaced by the new TabStop. /// </summary> public TabStop AddTabStop(TabStop tabStop) { if (tabStop == null) throw new ArgumentNullException("tabStop"); if (TabStopExists(tabStop.Position)) { int index = IndexOf(GetTabStopAt(tabStop.Position)); RemoveObjectAt(index); InsertObject(index, tabStop); } else { int count = Count; for (int index = 0; index < count; index++) { if (tabStop.Position.Point < ((TabStop)this[index]).Position.Point) { InsertObject(index, tabStop); return tabStop; } } Add(tabStop); } return tabStop; }
/// <summary> /// Adds a TabStop object to the collection. /// </summary> public void Add(TabStop tabStop) { this.TabStops.AddTabStop(tabStop); }
internal TabStopRenderer(DocumentObject domObj, RtfDocumentRenderer docRenderer) : base(domObj, docRenderer) { this.tabStop = domObj as TabStop; }