public void showRawWikiText() { var defaultTopPanelText = "You can refresh the Html view using F5 or Ctrl+R (or via the context menu (right-click on WikiText))"; var panel = MainDocumentPane.add_DocumentContent("Raw Wiki Text") .setAsActive() .add_WinForms_Panel(); //panel.clear(); //var wikiApi = new O2PlatformWikiAPI(); var topPanel = panel.add_1x1(false); var rawWiki = topPanel[0].add_TextArea(); var bottomPanel = topPanel[1].add_1x1x1("Pure Html", "Browser (pure html View)", "Browser (view using site's Styles)"); var htmlViewer = bottomPanel[0].add_RichTextBox(); var browserSimple = bottomPanel[1].add_WebBrowser(); var browserWithSyles = bottomPanel[2].add_WebBrowser(); Action <string> processWikiText = (wikiText) => { var htmlCode = WikiApi.parseText(wikiText); htmlViewer.set_Text(htmlCode); browserSimple.set_Text(htmlCode); browserWithSyles.set_Text(WikiApi.wrapOnHtmlPage(htmlCode)); }; MethodInvoker refresh = () => { topPanel[0].set_Text("Retrieving RawWiki Html code"); rawWiki.backColor(Color.LightPink); O2Thread.mtaThread( () => { processWikiText(rawWiki.get_Text()); rawWiki.backColor(Color.White); topPanel[0].set_Text(defaultTopPanelText); }); }; Action <KeyEventArgs> handlePressedKeys = (e) => { if (e.KeyValue == 116 || // F5 (key 116) or (e.Modifiers == Keys.Control && e.KeyValue == 'R')) // Ctrl+R it { refresh(); } }; rawWiki.KeyUp += (sender, e) => handlePressedKeys(e); //rawWiki.onEnter(processWikiText); rawWiki.add_ContextMenu().add_MenuItem("Show Html for Wiki Text", refresh); rawWiki.set_Text("===Raw WikiText===".line() + "this is simple text".line() + "* this is a bullet point"); refresh(); //panel_add_1x1( }