public static void Parse(RootToken rootToken) { var text = rootToken.Text; var matches = r.Matches(text); if (matches.Count == 0) return; foreach (Match m in matches) { var i1 = m.Index + 1; var i2 = m.Index + m.Length - 1; var names = m.Groups["name"]; var types = m.Groups["type"]; var n = names.Captures.Count; var param = FindParamToken(rootToken, i1, i2); var el = InsertElement(param, i1, i2, "params"); for (int i = 0; i < n; i++) { var name = names.Captures[i]; var j1 = name.Index; var j2 = name.Index + name.Length; InsertElement(el, j1, j2, "pname"); var type = types.Captures[i]; j1 = type.Index; j2 = type.Index + type.Length; InsertElement(el, j1, j2, "ptype"); } } }
public static void Parse(RootToken rootToken) { var text = rootToken.Text; var matches = r.Matches(text); if (matches.Count == 0) { return; } foreach (Match m in matches) { var i1 = m.Index + 1; var i2 = m.Index + m.Length - 1; var names = m.Groups["name"]; var types = m.Groups["type"]; var n = names.Captures.Count; var param = FindParamToken(rootToken, i1, i2); var el = InsertElement(param, i1, i2, "params"); for (int i = 0; i < n; i++) { var name = names.Captures[i]; var j1 = name.Index; var j2 = name.Index + name.Length; InsertElement(el, j1, j2, "pname"); var type = types.Captures[i]; j1 = type.Index; j2 = type.Index + type.Length; InsertElement(el, j1, j2, "ptype"); } } }
public static RootToken Parse(string text) { var root = XElement.Parse(text, LoadOptions.PreserveWhitespace); var rlist = new RangeList(root.Value); var rn = new RootToken(root, rlist); //ParamParser.Parse(rn); RemoveWhitespaces(rn, rlist); RemoveFormating(rn); return(rn); }
public static RootToken Parse(string text) { var root = XElement.Parse(text, LoadOptions.PreserveWhitespace); var rlist = new RangeList(root.Value); var rn = new RootToken(root, rlist); //ParamParser.Parse(rn); RemoveWhitespaces(rn, rlist); RemoveFormating(rn); return rn; }
static void RemoveWhitespaces(RootToken rt, RangeList list) { //var i1 = Clear(rt.StartIndex, rt, list); //ClearRange(i1, rt.EndIndex, list); }
public static FrameworkElement Build(RootToken rootToken, Hint hint) { var textBlock = new TextBlock().Fill(rootToken, hint); textBlock.TextWrapping = TextWrapping.WrapWithOverflow; return new HintDecorator { Child = textBlock }; }