Пример #1
0
		public DebugForm(BrowserController controller)
		{
			InitializeComponent();
			this.controller = controller;
			bRun.GotFocus += new EventHandler(bRun_GotFocus);
			controller.ExecuteScript(null, null, null,
				@"var ta = document.createElement('textarea');
document.body.appendChild(ta);
ta.style.position = 'fixed';
ta.style.left = '10px';
ta.style.top = '10px';
ta.style.width = '600px';
ta.style.height = '400px';
ta.style.display = 'none';
ta.ondblclick = function(){
	this.style.display = 'none';
};
document.body.box = ta;
$.Output = function(msg){
	document.body.box.style.display='';  
	document.body.box.value += msg + '\r\n';
};
$.LogObj = function(obj){
	$.Output('=====================');
	for (var p in obj){
		$.Output(p + ':\t' + obj[p])
		$.Output('-----------------');
	}
	$.Output('=====================');
};
				");
		}
Пример #2
0
		void MasterForm_Shown(object sender, EventArgs e)
		{
			
			controller = new BrowserController { Browser = this.browser };
			controller.Browser.Navigating += new WebBrowserNavigatingEventHandler(Browser_Navigating);
			controller.Browser.DocumentCompleted += new WebBrowserDocumentCompletedEventHandler(Browser_DocumentCompleted);
			controller.Navigate(homeUrl);
			Log(homeUrl, tAddress);
			
		}