private void Render(Renderable render)
 {
     this.selectedObject = render;
     string json = render.ToJson();
     this.InvokeScript(this.RenderMethod, json);
 }
        private void SelectResources(Renderable render, out string html, out string script)
        {
            switch (render.RenderType) {
                case RenderType.Character:
                    html = Properties.Resources.characterStatblock_html;
                    script = Properties.Resources.characterStatblock_js;
                    break;

                case RenderType.Monster:
                    html = Properties.Resources.monsterStatblock_html;
                    script = Properties.Resources.monsterStatblock_js;
                    break;

                default:
                    throw new ArgumentException("Unknown RenderType", "RenderType");
            }
        }
        private void BrowseToResource(Renderable render)
        {
            WebBrowserDocumentCompletedEventHandler completedHandler = null;
            string html, script;
            this.SelectResources(render, out html, out script);

            completedHandler = (sender, e) => {
                this.StopListeningAndAddCommonHtmlElements(completedHandler);
                this.AddScriptElement(script);
                this.Render(render);
            };

            this.AllowNavigation = true;
            this.DocumentCompleted += completedHandler;
            this.DocumentText = html;
        }