DateTime tThen = DateTime.Now;
do
{
Application.DoEvents();
} while (!cefGlueBrowserForm.Done || tThen.AddSeconds(15) > DateTime.Now);
string htmlSource = cefGlueBrowserForm.DocumentDomHtml;
propertyBag.GetResponse = () => new MemoryStream(Encoding.UTF8.GetBytes(htmlSource));
cefGlueBrowserForm.Dispose();
After few hours I get in line
while (!cefGlueBrowserForm.Done || tThen.AddSeconds(15) > DateTime.Now);
exception of
An unhandled exception of type 'System.StackOverflowException' occurred in System.Windows.Forms.dll
Here is description of error: http://msdn.microsoft.com/en-us/library/w6sxk224%28v=vs.90%29.aspx
Make sure you do not have an infinite loop or infinite recursion.
Too many method calls is often indicative of a very deep or unbounded recursion.
so what Can I do? I need to wait until some code in cefGlueBrowserForm is finished or time is reached. But why then error, I have time check...