public static IHTMLDocument2 GetDocument(this IControlHtml ctrlHtml) { var hwnd = ctrlHtml.DocumentHwnd; return(hwnd != null ? IEComHelper.GetDocumentFromHwnd(hwnd.Value) : null); }
private IHTMLDocument2 GetDocument() { if (_documentHwnd == null) { _documentHwnd = GetDocumentHwnd(); } return(_documentHwnd == null ? null : IEComHelper.GetDocumentFromHwnd(_documentHwnd.Value)); }