Beispiel #1
0
 /// <summary>
 /// Finds next close string
 /// </summary>
 /// <param name="text">List of strings</param>
 /// <param name="openString">Open string</param>
 /// <param name="closeString">Close string</param>
 /// <param name="beg">The "begin" sign</param>
 /// <param name="bRow">Rebin row</param>
 /// <param name="bColumn">Begin column</param>
 /// <param name="eRow">End row</param>
 /// <param name="eColumn">End column</param>
 protected virtual void FindNextClose(IList <string> text, string openString, string closeString,
                                      bool beg, int bRow, int bColumn, out int eRow, out int eColumn)
 {
     StaticExtensionXmlParserLibrary.FindNextClose(text, openString, closeString, true, bRow, bColumn, out eRow, out eColumn);
 }
Beispiel #2
0
        /// <summary>
        /// Creates Xml Element from strings
        /// </summary>
        /// <param name="text">The strings</param>
        /// <param name="bRow">The begin row</param>
        /// <param name="bColumn">The begin column</param>
        /// <param name="eRow">The end row</param>
        /// <param name="eColumn">The end column</param>
        /// <returns>Created Xml Element</returns>
        protected virtual XElement CreateInternal(IList <string> text, int bRow, int bColumn, int eRow, int eColumn)
        {
            List <int> l = null;

            if (dic.ContainsKey(bRow))
            {
                l = dic[bRow];
            }
            else
            {
                l         = new List <int>();
                dic[bRow] = l;
            }
            if (l.Contains(eRow))
            {
                return(null);
            }
            l.Add(eRow);
            int      bbRow    = bRow;
            int      bbColumn = bColumn;
            int      eeRow;
            int      eeColumn;
            XElement element = creator.Create(text, bRow, bColumn, eRow, eColumn);

            if (element == null)
            {
                return(null);
            }
            while (true)
            {
                char?c = StaticExtensionXmlParserLibrary.FindNext(text, openSymbol, false, bbRow, bbColumn, out eeRow, out eeColumn);
                if (c == null)
                {
                    return(element);
                }
                if (eeRow >= eRow)
                {
                    break;
                }
                if (eeRow == eRow)
                {
                    if (eeColumn >= eColumn)
                    {
                        break;
                    }
                }
                bbRow    = eeRow;
                bbColumn = eeColumn;
                StaticExtensionXmlParserLibrary.FindNextClose(text, openSymbol, closeSymbol, true, bbRow, bbColumn, out eeRow, out eeColumn);
                XElement e = This.Create(text, bbRow, bbColumn, eeRow, eeColumn);
                if (e != null)
                {
                    element.Add(e);
                }
                bbRow     = eeRow;
                bbColumn  = eeColumn;
                endRow    = eeRow;
                endColumn = eeColumn;
            }
            return(element);
        }