public void onDocumentCompleted(IO2HtmlPage htmlPage)
        {
            "---- onDocumentCompleted".info();
            var o2BrowserIE = (O2BrowserIE)browser;

            //this.info("---- Text: {0}" , o2BrowserIE.Text());
            setEditMode(true);
        }
Ejemplo n.º 2
0
 public void pageLoaded(IO2HtmlPage htmlPage)
 {
     htmlPages_TreeView.add_Node(htmlPage);
     if (htmlPages_TreeView.Nodes.Count == 1)
     {
         htmlPages_TreeView.SelectedNode = htmlPages_TreeView.Nodes[0];
     }
 }
Ejemplo n.º 3
0
        public static List <String> forms(this IO2HtmlPage htmlPage)
        {
            var forms = new List <String>();

            foreach (var form in htmlPage.Forms)
            {
                forms.add(form.str());
            }
            return(forms);
        }
Ejemplo n.º 4
0
 public static IO2HtmlForm form(this IO2HtmlPage htmlPage, string nameOrId)
 {
     foreach (var form in htmlPage.Forms)
     {
         if (form.Name == nameOrId || form.Id == nameOrId)
         {
             return(form);
         }
     }
     return(null);
 }
Ejemplo n.º 5
0
        // calculate JavaScripts from IE_HtmlPage

        public static List <KeyValuePair <string, string> > javaScripts(this IO2HtmlPage htmlPage)
        {
            var javaScripts = new List <KeyValuePair <string, string> >();

            foreach (var script in htmlPage.Scripts)
            {
                if (script.Text.valid())
                {
                    javaScripts.add("Inside ScriptBlock       (size: {0:0.00} k )".format((double)script.Text.size() / 1024), script.Text);
                }

                if (script.Src.valid() && script.Src.isUri())
                {
                    var scriptFileContents = script.Src.uri().getHtml();
                    javaScripts.add("{0}       (size:  {1:0.00} k )".format(script.Src, (double)scriptFileContents.size() / 1024), scriptFileContents);
                }
            }
            return(javaScripts);
        }
        /* void O2BrowserIE_Navigating(object sender, WebBrowserNavigatingEventArgs e)
        {
         //   PublicDI.log.info("Navigating: {0} ({1}", e.Url, e.TargetFrameName);
            //throw new NotImplementedException();
        }

        void O2BrowserIE_Navigated(object sender, WebBrowserNavigatedEventArgs e)
        {
         //   PublicDI.log.info("Navigated: {0}", e.Url);
        }*/

        void O2BrowserIE_DocumentComplete(object sender, DocumentCompleteEventArgs e)
        {
            
            if (DebugMode)
                PublicDI.log.debug("in O2BrowserIE_DocumentComplete for:{0}", e.Url); 
            ////var uri = (Uri) e.Url;            
            try
            {
                HtmlPage = new IE_HtmlPage(e.DocumentClass);
                documentCompleted.Set();
                if (onDocumentCompleted != null)
                    onDocumentCompleted(HtmlPage);
            }
            catch (Exception ex)
            {
                PublicDI.log.ex(ex,"O2BrowserIE_DocumentComplete:",  true);
                documentCompleted.Set();
            }                        
        }
Ejemplo n.º 7
0
        public void showPageDetails(IO2HtmlPage htmlPage)
        {
            var url = htmlPage.PageUri;

            "copying page url to the clipboard: {0}".info(url.str());
            url.str().toClipboard();
            groupBoxes[2].clear();
            var tabControl = groupBoxes[2].add_TabControl();

            if (htmlPage.Forms != null)
            {
                foreach (var form in htmlPage.Forms)
                {
                    tabControl.add_Tab_IfListHasData("Form '" + form.ToString() + "' Fields", form.FormFields);
                }
            }

            tabControl.add_Tab_IfListHasData("Anchors", htmlPage.Anchors);
            tabControl.add_Tab_IfListHasData("Images", htmlPage.Images);
            tabControl.add_Tab_IfListHasData("Links", htmlPage.Links);
            tabControl.add_Tab_IfListHasData("Forms", htmlPage.Forms);
            tabControl.add_Tab_IfListHasData("Scripts", htmlPage.Scripts);

            add_Config_Tab(tabControl, webBrowser);
            //var htmlCode = tabControl.add_Tab("Html Code").add_RichTextBox();

            /*if (htmlPage.Links.Count >0)
             *      tabControl.add_Tab("Links").add_TableList(htmlPage.Links);
             * if (htmlPage.Forms.Count >0)
             *      tabControl.add_Tab("Forms").add_TableList(htmlPage.Forms);
             * if (htmlPage.Scripts.Count >0)
             *      tabControl.add_Tab("Scripts").add_TableList(htmlPage.Scripts);
             */
            /*var sourceCodeViewer = tabControl.add_Tab("Html Code").add_SourceCodeViewer();
             * var sourceCodeEditor = sourceCodeViewer.getSourceCodeEditor();
             * sourceCodeEditor.setDocumentContents(htmlPage.PageSource,"aaa.html");
             * tabControl.add_Tab("Links").add_RichTextBox();
             * tabControl.add_Tab("Forms").add_RichTextBox();
             * tabControl.add_Tab("Scripts").add_RichTextBox();*/
            //tabControl.add_Tab("Links").add_RichTextBox();
            //htmlCode.set_Text(htmlPage.PageSource);
        }
Ejemplo n.º 8
0
 public void open(Uri uri)
 {
     if (uri != null)
     {
         try
         {
             if (DebugMode)
             {
                 PublicDI.log.debug("[O2BrowserIE] opening: {0}", uri.ToString());
             }
             Navigate(uri);
         }
         catch (Exception ex)
         {
             DI.log.error("in O2BrowserIE.open: {0}", ex.Message);
             documentCompleted.Set();
         }
     }
     HtmlPage = null;
 }
Ejemplo n.º 9
0
        /* void O2BrowserIE_Navigating(object sender, WebBrowserNavigatingEventArgs e)
         * {
         * //   PublicDI.log.info("Navigating: {0} ({1}", e.Url, e.TargetFrameName);
         *  //throw new NotImplementedException();
         * }
         *
         * void O2BrowserIE_Navigated(object sender, WebBrowserNavigatedEventArgs e)
         * {
         * //   PublicDI.log.info("Navigated: {0}", e.Url);
         * }*/

        void O2BrowserIE_DocumentComplete(object sender, DocumentCompleteEventArgs e)
        {
            if (DebugMode)
            {
                PublicDI.log.debug("in O2BrowserIE_DocumentComplete for:{0}", e.Url);
            }
            ////var uri = (Uri) e.Url;
            try
            {
                HtmlPage = new IE_HtmlPage(e.DocumentClass);
                documentCompleted.Set();
                if (onDocumentCompleted != null)
                {
                    onDocumentCompleted(HtmlPage);
                }
            }
            catch (Exception ex)
            {
                PublicDI.log.ex(ex, "O2BrowserIE_DocumentComplete:", true);
                documentCompleted.Set();
            }
        }
    	public void showPageDetails(IO2HtmlPage htmlPage)
    	{    		
			var url = htmlPage.PageUri;
			"copying page url to the clipboard: {0}".info(url.str());
			url.str().toClipboard();
    		groupBoxes[2].clear();
    		var tabControl = groupBoxes[2].add_TabControl();
    		
    		if (htmlPage.Forms != null)
    			foreach(var form in htmlPage.Forms)    		
    				tabControl.add_Tab_IfListHasData("Form '"+ form.ToString() +"' Fields", form.FormFields);    		
    		
    		tabControl.add_Tab_IfListHasData("Anchors", htmlPage.Anchors);
    		tabControl.add_Tab_IfListHasData("Images", htmlPage.Images);
    		tabControl.add_Tab_IfListHasData("Links", htmlPage.Links);
    		tabControl.add_Tab_IfListHasData("Forms", htmlPage.Forms);
    		tabControl.add_Tab_IfListHasData("Scripts", htmlPage.Scripts);    
    			
    		add_Config_Tab(tabControl, webBrowser);
    		//var htmlCode = tabControl.add_Tab("Html Code").add_RichTextBox();
    		
    		/*if (htmlPage.Links.Count >0)
    			tabControl.add_Tab("Links").add_TableList(htmlPage.Links);
    		if (htmlPage.Forms.Count >0)	
    			tabControl.add_Tab("Forms").add_TableList(htmlPage.Forms);
    		if (htmlPage.Scripts.Count >0)	
    			tabControl.add_Tab("Scripts").add_TableList(htmlPage.Scripts);
    		*/    		    		
    		/*var sourceCodeViewer = tabControl.add_Tab("Html Code").add_SourceCodeViewer();
    		var sourceCodeEditor = sourceCodeViewer.getSourceCodeEditor();
    		sourceCodeEditor.setDocumentContents(htmlPage.PageSource,"aaa.html");
    		tabControl.add_Tab("Links").add_RichTextBox();
    		tabControl.add_Tab("Forms").add_RichTextBox();
    		tabControl.add_Tab("Scripts").add_RichTextBox();*/
    		//tabControl.add_Tab("Links").add_RichTextBox();
    		//htmlCode.set_Text(htmlPage.PageSource);
    	}
		public void onDocumentCompleted(IO2HtmlPage htmlPage)
		{
			"---- onDocumentCompleted".info();
			var o2BrowserIE = (O2BrowserIE)browser;
			
			//this.info("---- Text: {0}" , o2BrowserIE.Text());
			setEditMode(true);
		}
        public void open(Uri uri)
        {
            if (uri != null)
            {
                try
                {
                    if (DebugMode)
                        PublicDI.log.debug("[O2BrowserIE] opening: {0}", uri.ToString());
                    Navigate(uri);
                }
                catch (Exception ex)
                {
                    DI.log.error("in O2BrowserIE.open: {0}", ex.Message);
                    documentCompleted.Set();

                }
            }
            HtmlPage = null; 
        }
 	public void pageLoaded(IO2HtmlPage htmlPage)
 	{
 		 htmlPages_TreeView.add_Node(htmlPage);
 		 if (htmlPages_TreeView.Nodes.Count == 1)
 		 	htmlPages_TreeView.SelectedNode = htmlPages_TreeView.Nodes[0];
 	}
Ejemplo n.º 14
0
 public static string html(this IO2HtmlPage htmlPage)
 {
     return(htmlPage.PageSource);
 }