private static RegexItem newItemByXElement(XElement xelement, string key) { RegexItem item = new RegexItem(); item.ParentKey = key; item.ItemKey = xelement.Element("key").Value; item.ItemValue = xelement.Element("value").Value; return(item); }
private static RegexItem newItemByLine(string content, string key) { string[] array = splitLine(content); RegexItem item = new RegexItem(); item.ParentKey = key; item.ItemKey = array[0]; item.ItemValue = array[1].Trim(); return(item); }
private static IList <RawSection> parserRawSectionsBySingleRegex(IList <RawSection> sections, RegexItem regexItem) { IList <RawSection> result = new List <RawSection>(); foreach (RawSection section in sections) { string[] strArray = regexItem.getRegex().Split(section.Content); if (strArray.Length < 2) { result.Add(section); } else { Console.WriteLine("else branch is reached."); } } return(result); }