public void DocumentComplete(object pDisp, ref object urlObject)
 {
     this.haveNavigated = true;
     if ((this.parent.documentStreamToSetOnLoad != null) && (((string)urlObject) == "about:blank"))
     {
         HtmlDocument document = this.parent.Document;
         if (document != null)
         {
             System.Windows.Forms.UnsafeNativeMethods.IPersistStreamInit domDocument = document.DomDocument as System.Windows.Forms.UnsafeNativeMethods.IPersistStreamInit;
             System.Windows.Forms.UnsafeNativeMethods.IStream            pstm        = new System.Windows.Forms.UnsafeNativeMethods.ComStreamFromDataStream(this.parent.documentStreamToSetOnLoad);
             domDocument.Load(pstm);
             document.Encoding = "unicode";
         }
         this.parent.documentStreamToSetOnLoad = null;
     }
     else
     {
         string uriString = (urlObject == null) ? "" : urlObject.ToString();
         WebBrowserDocumentCompletedEventArgs e = new WebBrowserDocumentCompletedEventArgs(new Uri(uriString));
         this.parent.OnDocumentCompleted(e);
     }
 }
 public void DocumentComplete(object pDisp, ref object urlObject)
 {
     this.haveNavigated = true;
     if ((this.parent.documentStreamToSetOnLoad != null) && (((string) urlObject) == "about:blank"))
     {
         HtmlDocument document = this.parent.Document;
         if (document != null)
         {
             System.Windows.Forms.UnsafeNativeMethods.IPersistStreamInit domDocument = document.DomDocument as System.Windows.Forms.UnsafeNativeMethods.IPersistStreamInit;
             System.Windows.Forms.UnsafeNativeMethods.IStream pstm = new System.Windows.Forms.UnsafeNativeMethods.ComStreamFromDataStream(this.parent.documentStreamToSetOnLoad);
             domDocument.Load(pstm);
             document.Encoding = "unicode";
         }
         this.parent.documentStreamToSetOnLoad = null;
     }
     else
     {
         string uriString = (urlObject == null) ? "" : urlObject.ToString();
         WebBrowserDocumentCompletedEventArgs e = new WebBrowserDocumentCompletedEventArgs(new Uri(uriString));
         this.parent.OnDocumentCompleted(e);
     }
 }