public void Visit(Quote code) { var inlineContainer = new InlineUIContainer(); SnuDomCategoryVisitor categoryVisitor = new SnuDomCategoryVisitor(); foreach (var item in code) { item.Accept(categoryVisitor); } if (categoryVisitor.Category == MarkdownCategory.PlainText && code.Count() == 1) { var plainTextVisitor = new SnuDomPlainTextVisitor(); foreach (var item in code) item.Accept(plainTextVisitor); inlineContainer.Child = new MarkdownQuote(plainTextVisitor.Result); } else { var fullUIVisitor = new SnuDomFullUIVisitor(_forgroundBrush); //cant be null in this category foreach (var item in code) item.Accept(fullUIVisitor); inlineContainer.Child = new MarkdownQuote(fullUIVisitor.Result); } if (_currentParagraph == null) { MaybeSplitForParagraph(); } else { _currentParagraph.Inlines.Add(new Windows.UI.Xaml.Documents.LineBreak()); } _currentParagraph.Inlines.Add(inlineContainer); _currentParagraph.Inlines.Add(new Windows.UI.Xaml.Documents.LineBreak()); }
public void Visit(Quote code) { SnuDomCategoryVisitor categoryVisitor = new SnuDomCategoryVisitor(); UIElement result = null; foreach (var item in code) { item.Accept(categoryVisitor); } if (categoryVisitor.Category == MarkdownCategory.PlainText && code.Count() == 1) { var plainTextVisitor = new SnuDomPlainTextVisitor(); foreach (var item in code) item.Accept(plainTextVisitor); result = new MarkdownQuote(plainTextVisitor.Result); } else { var fullUIVisitor = new SnuDomFullUIVisitor(_forgroundBrush); //cant be null in this category foreach (var item in code) item.Accept(fullUIVisitor); if (fullUIVisitor.ResultGroup != null) { result = new MarkdownQuote(fullUIVisitor.ResultGroup); } else { result = new MarkdownQuote(fullUIVisitor.Result); } } DirectlyPlaceUIContent(result); }