Exemplo n.º 1
0
        /// <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);
        }
Exemplo n.º 2
0
        /// <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);
        }
Exemplo n.º 3
0
        /// <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);
        }
Exemplo n.º 4
0
        /// <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);
        }
Exemplo n.º 5
0
        /// <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));
        }
Exemplo n.º 6
0
        /// <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);
        }
Exemplo n.º 7
0
        /// <summary>
        /// Converts TabStops into DDL.
        /// </summary>
        internal override void Serialize(Serializer serializer)
        {
            if (fClearAll)
            {
                serializer.WriteLine("TabStops = null");
            }

            int count = Count;

            for (int index = 0; index < count; index++)
            {
                TabStop tabstop = (TabStop)this[index];
                tabstop.Serialize(serializer);
            }
        }
Exemplo n.º 8
0
        /// <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;
        }
Exemplo n.º 9
0
 /// <summary>
 /// Adds a TabStop object to the collection.
 /// </summary>
 public void Add(TabStop tabStop)
 {
     this.TabStops.AddTabStop(tabStop);
 }