public frmConversation(Connection ThisConnection, string ConversationID) { InitializeComponent(); this.ThisConnection = ThisConnection; this.ConversationID = ConversationID; ClickHandler = new HtmlElementEventHandler(frmConversation_Click); MouseDownHandler = new HtmlElementEventHandler(frmConversation_MouseDown); ClearMessages(); //LOAD THE EMOTICONS FROM THE CONFIG FILE Emoticons = ConfigWrapper.GetSetting(Path.Combine(Application.StartupPath, "Images\\Emoticons\\emoticons.xml"), "icon"); //CREATE A NEW EMOTICONS DISPLAY EmoticonsDisplay = new frmEmoticons(this, Emoticons); EmoticonsDisplay.EmoticonClicked += new frmEmoticons.EmoticonClickedDelegate(EmoticonsDisplay_EmoticonClicked); //CREATE PLUGIN LIST CreatePluginList(); //DETERMINE IF THE TIMESTAMPS SHOULD BE ENABLED BY DEFAULT OR NOT if (ConfigWrapper.GetSetting("ConversationSettings").FirstOrDefault() != null) { timestampToolStripMenuItem.Checked = bool.Parse(ConfigWrapper.GetSetting("ConversationSettings").FirstOrDefault()["ShowTimeStamps"]); } else { timestampToolStripMenuItem.Checked = true; } }
private void OnStop(object sender, EventArgs e) { HtmlElementEventHandler eh = (HtmlElementEventHandler) Events[StopEvent]; if (eh != null) { HtmlElementEventArgs ev = new HtmlElementEventArgs (); eh (this, ev); } }
private void OnLosingFocus(object sender, EventArgs e) { HtmlElementEventHandler eh = (HtmlElementEventHandler) Events[LosingFocusEvent]; if (eh != null) { HtmlElementEventArgs ev = new HtmlElementEventArgs (); eh (this, ev); } }
private void wbBizeen_DocumentCompleted(object sender, WebBrowserDocumentCompletedEventArgs e) { if (_clickHandler != null) { wbBizeen.Document.GetElementById(ID_IMG_CLOSE).Click += _clickHandler; } _clickHandler = null; _loadCompleted = true; }
/// <summary> /// Extends BeginInvoke so that when a state object is not needed, null does not need to be passed. /// <example> /// htmlelementeventhandler.BeginInvoke(sender, e, callback); /// </example> /// </summary> public static IAsyncResult BeginInvoke(this HtmlElementEventHandler htmlelementeventhandler, Object sender, HtmlElementEventArgs e, AsyncCallback callback) { if (htmlelementeventhandler == null) { throw new ArgumentNullException("htmlelementeventhandler"); } return(htmlelementeventhandler.BeginInvoke(sender, e, callback, null)); }
internal void OnResize(object sender, EventArgs ev) { HtmlElementEventHandler eh = (HtmlElementEventHandler)(Events[ResizeEvent]); if (eh != null) { HtmlElementEventArgs e = new HtmlElementEventArgs(); eh(this, e); } }
internal void OnLostFocus(object sender, EventArgs ev) { HtmlElementEventHandler eh = (HtmlElementEventHandler)(Events[LostFocusEvent]); if (eh != null) { HtmlElementEventArgs e = new HtmlElementEventArgs(); eh(this, e); } }
private void OnDoubleClick(object sender, EventArgs e) { HtmlElementEventHandler eh = (HtmlElementEventHandler)Events[DoubleClickEvent]; if (eh != null) { HtmlElementEventArgs ev = new HtmlElementEventArgs(); eh(this, ev); } }
private void SetEventHandler(HtmlElement element, String linkValue) { element.SetAttribute("onclick", ""); element.SetAttribute("link", linkValue); HtmlElementEventHandler clickEvent = new HtmlElementEventHandler(this.Link_OnClick); element.Click -= clickEvent; element.Click += clickEvent; element.SetAttribute("href", "#"); element.SetAttribute("target", "_self"); }
private void OnContextMenuShowing(object sender, Mono.WebBrowser.ContextMenuEventArgs e) { HtmlElementEventHandler eh = (HtmlElementEventHandler) Events[ContextMenuShowingEvent]; if (eh != null) { HtmlElementEventArgs ev = new HtmlElementEventArgs (); eh (this, ev); if (ev.ReturnValue) { owner.OnWebHostContextMenuShown (sender, e); } } }
void CtlWebBrowser_DocumentCompleted(object sender, WebBrowserDocumentCompletedEventArgs e) { foreach (HtmlElement element in Document.All) { if (!Common.IsNullOrEmpty(element.GetAttribute("sender"))) { HtmlElementEventHandler handler = new HtmlElementEventHandler(FireElementClicked); element.Click -= handler; element.Click += handler; } } }
/// <summary> /// Adds event handlers (for 'Click') for all added buttons. /// </summary> private void AddPayButtonHandlers() { for (int i = 0; i < button.Length; i++) { HtmlElement buttonTmp = webBrowser.Document.GetElementById("plugin_payButton_" + i); if (buttonTmp != null) { HtmlElementEventHandler e = new HtmlElementEventHandler(this.PayButton_Click); button[i] = buttonTmp; button[i].Click -= e; // remove the old one button[i].Click += e; } } }
public MainForm() { InitializeComponent(); wbBizeen.DocumentText = File.ReadAllText("resources\\page.htm"); wbBizeen.Document.MouseDown += new HtmlElementEventHandler(Document_MouseDown); wbBizeen.Document.MouseMove += new HtmlElementEventHandler(Document_MouseMove); wbBizeen.Document.MouseUp += new HtmlElementEventHandler(Document_MouseUp); wbBizeen.DocumentCompleted += new WebBrowserDocumentCompletedEventHandler(wbBizeen_DocumentCompleted); wbBizeen.NewWindow += new CancelEventHandler(wbBizeen_NewWindow); wbBizeen.Navigating += new WebBrowserNavigatingEventHandler(wbBizeen_Navigating); _clickHandler = new HtmlElementEventHandler(CloseButton_Click); this.Cursor = Cursors.Hand; Cursor.Current = Cursors.Hand; }
// Methods public HtmlElementEventHandlerWrapper(HtmlElementEventHandler eventHandler, MethodInvoker doEvent) { if (eventHandler == null) { throw new ArgumentNullException("eventHandler"); } base.Target = eventHandler.Target; base.Method = eventHandler.Method; this.HtmlEventHandler = (HtmlElementEventHandler)Delegate.Combine(this.HtmlEventHandler, new HtmlElementEventHandler(this.Invoke)); base.DoEvent = (MethodInvoker)Delegate.Combine(base.DoEvent, doEvent); bgWorker = new BackgroundWorker(); bgWorker.WorkerSupportsCancellation = true; bgWorker.DoWork += new DoWorkEventHandler(bgWorker_DoWork); bgWorker.RunWorkerCompleted += new RunWorkerCompletedEventHandler(bgWorker_RunWorkerCompleted); }
private void DragCorner(HtmlElement container) { HtmlElement handle = container.GetElementsByTagName("div")[0]; HtmlElement txtarea = container.GetElementsByTagName("textarea")[0]; HtmlElementEventHandler handler = (sender, args) => MoveListener(sender, (HtmlElementEventArgs)args, container, txtarea); /* Listen for 'mouse down' on handle to start the move listener */ handle.MouseDown += (mdSender, mdArgs) => { locationX = mdArgs.ClientMousePosition.X; locationY = mdArgs.ClientMousePosition.Y; /* Start listening for mouse move on body */ webBrowser1.Document.MouseMove += handler; }; /* Listen for 'mouse up' to cancel 'move' listener */ webBrowser1.Document.MouseUp += (sender, e) => { webBrowser1.Document.MouseMove -= handler; }; }
/// <summary> /// Adds options to the iRachunki.pl mini web menu. /// </summary> private void AddMenuOptions() { if (webBrowser.Document.GetElementById("plugin_close_link") != null) { return; } HtmlElement menuList = webBrowser.Document.GetElementById("menuList"); if (menuList == null) { return; } HtmlElement li = webBrowser.Document.CreateElement("li"); HtmlElement link = webBrowser.Document.CreateElement("a"); link.Id = "plugin_close_link"; link.SetAttribute("href", "#"); link.SetAttribute("onclick", String.Format(FOCUS_SCRIPT, "close")); link.InnerHtml = Resources.ClosePlugin; li.AppendChild(link); menuList.AppendChild(li); HtmlElement input = webBrowser.Document.CreateElement("input"); input.SetAttribute("id", "plugin_close_input"); input.SetAttribute("type", "text"); input.Style = "display: none; width: 0px; height: 0px;"; // this invisible element handles click elements on many links of the SideBar content // as well as some other notification events HtmlElementEventHandler focusEvent = new HtmlElementEventHandler(this.Link_OnClick); input.GotFocus -= focusEvent; input.GotFocus += focusEvent; webBrowser.Document.Body.AppendChild(input); }
private void webBrowser2_DocumentCompleted(object sender, WebBrowserDocumentCompletedEventArgs e) { HtmlDocument Document = webBrowser2.Document; HtmlElementEventHandler mouseDownEvent = new HtmlElementEventHandler(EventoClickMouse); Document.Body.MouseDown += mouseDownEvent; }
protected void AppendButton(HtmlElement parent, string text, string idAttr, string classAttr, HtmlElementEventHandler clickEvent) { HtmlElement element = View.Document.CreateElement("a"); element.InnerText = text; element.SetAttribute("href", "#"); element.SetAttribute("id", idAttr); element.SetAttribute("class", classAttr); element.Click += clickEvent; parent.AppendChild(element); }