Esempio n. 1
0
        public ascx_HtmlTagViewer buildGui(bool addLoadUrlTextBox, bool addHtmlCodeViewer)
        {
            //return (ascx_HtmlTagViewer)this.invokeOnThread(
            //	()=>{
            var TopPanel = this.add_Panel();

            HtmlTags_TreeView = TopPanel.add_TreeView_for_HtmlTags()
                                .showSelection();

            if (addHtmlCodeViewer)
            {
                HtmlCodeViewer = HtmlTags_TreeView.insert_Left <Panel>(TopPanel.width() / 2).add_SourceCodeViewer();

                HtmlTags_TreeView.after_TagSelect_showIn_SouceCodeViewer(HtmlCodeViewer);

                var optionsPanel = HtmlCodeViewer.insert_Below <Panel>(50);
                optionsPanel.add_CheckBox("View as Xml", 0, 5,
                                          (value) => {
                    ViewAsXml = value;
                    reloadPage();
                })
                .append_Label("Search html code:")
                .top(5)
                .append_TextBox("")
                .onTextChange((text) => HtmlCodeViewer.editor().invoke("searchForTextInTextEditor_findNext", text))
                .onEnter((text) => HtmlCodeViewer.editor().invoke("searchForTextInTextEditor_findNext", text))
                .align_Right(optionsPanel);

                optionsPanel.add_Link("Refresh tags", 30, 0, () => show(HtmlCodeViewer.get_Text()));
            }

            if (addLoadUrlTextBox)
            {
                PageToOpen = TopPanel.insert_Above <Panel>(20).add_TextBox().fill();
                var propertyGrid = HtmlTags_TreeView.insert_Right <Panel>(150).add_PropertyGrid();


                HtmlTags_TreeView.afterSelect <HtmlAgilityPack.HtmlNode>(
                    (htmlNode) => propertyGrid.show(htmlNode));

                PageToOpen.onEnter(
                    (text) => {
                    if (text.fileExists())
                    {
                        show(text.fileContents());
                    }
                    else
                    {
                        show(text.uri());
                    }
                });
            }

            HtmlNodeFilter = HtmlTags_TreeView.insert_Below_HtmlTagFilter((filter) => show(HtmlCode, filter));

            return(this);
            //});
        }
 public void updateSerializedStringSyncWithPropertyGrid()
 {
     //this.serializedString.onTextChange(
     //	(text)=>{
     if (guiReady && ShowSerializedString)
     {
         try
         {
             var text      = serializedString.get_Text();
             var newObject = Serialize.getDeSerializedObjectFromXmlFile(text.save(), RootObject.type());
             if (newObject.notNull())
             {
                 RootObject = newObject;
                 refresh();
             }
         }
         catch (Exception ex)
         {
             ex.log();
         }
     }
     //	});
 }
 public void processJavascript()
 {
     processJavascript(sourceCode.get_Text());
 }
Esempio n. 4
0
 public static string                    get_Code(this ascx_SourceCodeViewer sourceCodeViewer)
 {
     return(sourceCodeViewer.get_Text());
 }