public static bool SubscribeTo(this IHTMLElement2 element, EventType eventType, IControlHtmlEvent handlerObj) { try { return(element.IsNull() ? false : element.attachEvent(eventType.Name(), handlerObj)); } catch (RemotingException) { } catch (UnauthorizedAccessException) { } return(false); }
public static bool SubscribeTo(this IHTMLElement2 element, string @event, object pdisp) { try { return(element.IsNull() ? false : element.attachEvent(@event, pdisp)); } catch (RemotingException) { } catch (UnauthorizedAccessException) { } return(false); }