private static void GetOutlinableResults(Genero4glBlockTagger tagger, ITextView textView, NormalizedSnapshotSpanCollection spans, AstNode node, Genero4glCodeBlock parent, ITextSnapshot snapshot, int level, ref List <Genero4glCodeBlock> outlinables) { Genero4glCodeBlock curr = null; foreach (var child in node.Children) { if (child.Value != null) { var outRes = child.Value as IOutlinableResult; if (outRes.CanOutline && /*&& ShouldInclude(outRes, spans)*/ outRes.EndIndex < textView.TextSnapshot.Length) { curr = new Genero4glCodeBlock(tagger, textView, parent, GetBlockType(outRes), outRes, level + 1); if (curr != null) { outlinables.Add(curr); } } if (child.Value.Children.Count > 0) { if (curr == null) { curr = new Genero4glCodeBlock(tagger, textView, parent, BlockType.Unknown, null, level + 1); } GetOutlinableResults(tagger, textView, spans, child.Value, curr, snapshot, level + 1, ref outlinables); } } } }
// Methods public Genero4glCodeBlock(Genero4glBlockTagger tagger, ITextView textView, Genero4glCodeBlock parent, BlockType type, IOutlinableResult outlinable, int level) { _tagger = tagger; _textView = textView; this.parent = parent; if (parent != null) { parent.children.Add(this); } this.type = type; this.level = level; _outlinable = outlinable; }