Esempio n. 1
0
        public BrowserForm(AppDocument appDocument)
        {
            AppDocument     = appDocument;
            BrowserDocument = new BrowserDocument();

            InitializeComponent();
            SecureBrowserControl();
            HookupEvents();
        }
        public ITcpFrame BuildResponse(BrowserForm browserForm)
        {
            XmlPageRequestBody  xmlPageRequestBody;
            XmlPageRequestFrame xmlPageRequestFrame;

            xmlPageRequestFrame = XmlPageRequestFrame;
            xmlPageRequestBody  = xmlPageRequestFrame.XmlPageRequestBody;

            RequestResponseFrame responseFrame;

            NavigateAndSync(browserForm, xmlPageRequestBody);
            //string search = xmlPageRequestBody.ReceiveSearch;

            //	Wait until all navigation results are completed.
            BrowserDocument browserDocument = browserForm.BrowserDocument;

            browserDocument.NavigateManualResetEvent.WaitOne();

            //	Get the results of navigation
            string domText = browserDocument.DomText;
            string xmlText = browserDocument.XmlText;

            List <string> textList = new List <string>
            {
                domText,
                xmlText,
                browserDocument.DomContentOnly(),
                browserDocument.XmlContentOnly()
            };

            //	Frame the results.
            XmlPageReplyFrame xmlPageReplyFrame = new XmlPageReplyFrame(textList);

            responseFrame = new RequestResponseFrame(xmlPageReplyFrame.ToByteArray());

            //	Navigate to a blank page so the pool of browsers remains quiet.
            NavigateToBlank(browserForm);

            return(responseFrame);
        }