示例#1
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);
        }
示例#2
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);
        }
示例#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);
        }
示例#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);
        }
示例#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));
        }
示例#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);
        }
示例#7
0
        /// <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);
            }
        }
示例#8
0
        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();
        }
示例#9
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;
        }
示例#10
0
 /// <summary>
 /// Adds a TabStop object to the collection.
 /// </summary>
 public void Add(TabStop tabStop)
 {
     TabStops.AddTabStop(tabStop);
 }
示例#11
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);
        }
示例#12
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;
        }
示例#13
0
 /// <summary>
 /// Adds a TabStop object to the collection.
 /// </summary>
 public void Add(TabStop tabStop)
 {
     this.TabStops.AddTabStop(tabStop);
 }
示例#14
0
 /// <summary>
 /// Adds a TabStop object to the collection.
 /// </summary>
 public void Add(TabStop tabStop)
 {
     this.TabStops.AddTabStop(tabStop);
 }
示例#15
0
 internal TabStopRenderer(DocumentObject domObj, RtfDocumentRenderer docRenderer)
     : base(domObj, docRenderer)
 {
     this.tabStop = domObj as TabStop;
 }
示例#16
0
 /// <summary>
 /// Adds a TabStop object to the collection.
 /// </summary>
 public void Add(TabStop tabStop)
 {
     TabStops.AddTabStop(tabStop);
 }