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