コード例 #1
0
 public ListBuilder(int listIndent)         // KWI-FIX: added listIndent
 {
     _listIndent = listIndent;
     _parent     = null;
     _gap        = 0;
     _liGap      = GetLiGap(null);
 }
コード例 #2
0
 private ListBuilder(ListBuilder parent, bool ordered)
 {
     _parent  = parent;
     _liGap   = parent._liGap;
     _gap     = parent._gap + _listIndent + _liGap.GetGap(ordered);
     _liIndex = ordered ? 0 : -1;
 }
コード例 #3
0
 private ListBuilder(ListBuilder parent, bool ordered, int listIndent)         // KWI-FIX: added listIndent
 {
     _listIndent = listIndent;
     _parent     = parent;
     _liGap      = parent._liGap;
     _gap        = parent._gap + _listIndent + _liGap.GetGap(ordered);
     _liIndex    = ordered ? 0 : -1;
 }
コード例 #4
0
 internal ListBuilder(LiGap liGap)
 {
     _parent = null;
     _gap    = 0;
     if (liGap != null)
     {
         _liGap = liGap;
     }
     else
     {
         _liGap = GetLiGap(null);
     }
 }
コード例 #5
0
		public ListBuilder CloseList(IEditable output)
		{
			EnsureParagraphBoundary(output);
			ListBuilder result = _parent;
			if (result == null)
			{
				result = this;
			}

			if (result._parent == null)
			{
				_ = output.Append('\n');
			}

			return result;
		}
コード例 #6
0
 public void HandleTag(bool opening, string tag, IEditable output, IXMLReader xmlReader)
 {
     tag = tag.ToUpperInvariant();
     if (tag.Equals("LIC", StringComparison.Ordinal))
     {
         _listBuilder.Li(opening, output);
         return;
     }
     if (tag.Equals("OLC", StringComparison.Ordinal) || tag.Equals("ULC", StringComparison.Ordinal))
     {
         if (opening)
         {
             _listBuilder = _listBuilder.StartList(tag[0] == 'o', output);
         }
         else
         {
             _listBuilder = _listBuilder.CloseList(output);
         }
         return;
     }
 }
コード例 #7
0
        public void HandleTag(bool isOpening, string tag, IEditable output, IXMLReader xmlReader)
        {
            tag = tag.ToUpperInvariant();
            var isItem = tag == TagLi;

            // Is list item
            if (isItem)
            {
                _listBuilder.AddListItem(isOpening, output);
            }
            // Is list
            else
            {
                if (isOpening)
                {
                    var isOrdered = tag == TagOl;
                    _listBuilder = _listBuilder.StartList(isOrdered, output);
                }
                else
                {
                    _listBuilder = _listBuilder.CloseList(output);
                }
            }
        }
コード例 #8
0
 public ListBuilder()
 {
     _parent = null;
     _gap    = 0;
     _liGap  = GetLiGap(null);
 }
コード例 #9
0
 private ListBuilder _listBuilder;         // KWI-FIX: removed new, set in constructor
 public ListTagHandler(int listIndent)     // KWI-FIX: added constructor with listIndent property
 {
     _listBuilder = new ListBuilder(listIndent);
 }