Esempio n. 1
0
        protected virtual void LoadNewChildOffsets(OffsetList offsets)
        {
            ConfirmDefaultOffset();

            MyOffset.ChildOffsets.Clear();
            foreach (OffsetItem item in offsets)
            {
                MyOffset.ChildOffsets.Add(item);
            }
        }
Esempio n. 2
0
        /// <summary>
        /// Calculate the end position of the current tag's markup.
        /// This is used when the end position may not be specified.
        /// In that case, the next item's start position is used.
        /// </summary>
        /// <param name="offsets"></param>
        /// <param name="currentItem"></param>
        /// <returns></returns>
        protected int GetMarkupEndPosition(OffsetList offsets, int currentItem)
        {
            OffsetItem item = offsets[currentItem];             //assuming since this is internal we're not beyond list

            if (item.EndPosition > 0)
            {
                return(item.EndPosition);
            }
            else
            {
                if (currentItem + 1 >= offsets.Count)
                {
                    return(0);
                }
                else
                {
                    return(offsets[currentItem + 1].Position);
                }
            }
        }