void InsertIntoParagraph(Paragraph p, HelpExample example, Int32 nr) { p.Inlines.Add(new Run(Messages.CopyCommand) { Foreground = new SolidColorBrush(Colors.LightGray), FontSize = 10.0, Cursor = Cursors.Hand }); p.Inlines.LastInline.MouseDown += (sndr, evnt) => Clipboard.SetText(example.Example); p.Inlines.Add(new Run(Messages.ExecuteCommand) { Foreground = new SolidColorBrush(Colors.LightGray), FontSize = 10.0, Cursor = Cursors.Hand }); p.Inlines.LastInline.MouseDown += (sndr, evnt) => _console.Execute(example.Example); p.Inlines.Add(new Run(example.Example) { Foreground = new SolidColorBrush(Colors.Green) }); p.Inlines.Add(new LineBreak()); p.Inlines.Add(new Run(example.Description) { Foreground = new SolidColorBrush(Colors.DarkGray) }); p.Inlines.Add(new LineBreak()); }
void PrintExample(HelpExample example) { if (example != null) { formatter.AddExample(example.Example); formatter.AddDescription(example.Description); } }