Exemplo n.º 1
0
 private void OnLinkClicked(object sender, HtmlLinkClickedEventArgs e)
 {
     OnLinkClicked(e);
 }
Exemplo n.º 2
0
 /// <summary>
 /// Handle links clicked in the label.
 /// </summary>
 /// <param name="sender">The control</param>
 /// <param name="args">The link click arguments</param>
 private void OnLinkClicked(object sender, HtmlLinkClickedEventArgs args)
 {
     _layout.Container.RaiseLink(args.Link);
     args.Handled = true;
 }
Exemplo n.º 3
0
 /// <summary>
 /// Propagate the LinkClicked event from root container.
 /// </summary>
 protected virtual void OnLinkClicked(HtmlLinkClickedEventArgs e)
 {
     var handler = LinkClicked;
     if (handler != null)
         handler(this, e);
 }
        /// <summary>
        /// Handle link clicked going over <see cref="LinkClicked"/> event and using <see cref="Process.Start()"/> if not canceled.
        /// </summary>
        /// <param name="parent">the control hosting the html to invalidate</param>
        /// <param name="location">the location of the mouse</param>
        /// <param name="link">the link that was clicked</param>
        internal void HandleLinkClicked(RControl parent, RPoint location, CssBox link)
        {
            EventHandler<HtmlLinkClickedEventArgs> clickHandler = LinkClicked;
            if (clickHandler != null)
            {
                var args = new HtmlLinkClickedEventArgs(link.HrefLink, link.HtmlTag.Attributes);
                try
                {
                    clickHandler(this, args);
                }
                catch (Exception ex)
                {
                    throw new HtmlLinkClickedException("Error in link clicked intercept", ex);
                }
                if (args.Handled)
                    return;
            }

            if (!string.IsNullOrEmpty(link.HrefLink))
            {
                if (link.HrefLink.StartsWith("#") && link.HrefLink.Length > 1)
                {
                    EventHandler<HtmlScrollEventArgs> scrollHandler = ScrollChange;
                    if (scrollHandler != null)
                    {
                        var rect = GetElementRectangle(link.HrefLink.Substring(1));
                        if (rect.HasValue)
                        {
                            scrollHandler(this, new HtmlScrollEventArgs(rect.Value.Location));
                            HandleMouseMove(parent, location);
                        }
                    }
                }
                else
                {
                    var nfo = new ProcessStartInfo(link.HrefLink);
                    nfo.UseShellExecute = true;
                    Process.Start(nfo);
                }
            }
        }
Exemplo n.º 5
0
 private void OnLinkClicked(object sender, HtmlLinkClickedEventArgs e)
 {
     if (CheckAccess())
         OnLinkClicked(e);
     else
         Dispatcher.Invoke(new Action<HtmlLinkClickedEventArgs>(OnLinkClicked), e);
 }
Exemplo n.º 6
0
 /// <summary>
 /// Propagate the LinkClicked event from root container.
 /// </summary>
 protected virtual void OnLinkClicked(HtmlLinkClickedEventArgs e)
 {
     RoutedEventArgs newEventArgs = new RoutedEvenArgs<HtmlLinkClickedEventArgs>(LinkClickedEvent, this, e);
     RaiseEvent(newEventArgs);
 }
Exemplo n.º 7
0
 /// <summary>
 /// On specific link click handle it here.
 /// </summary>
 private static void OnLinkClicked(object sender, HtmlLinkClickedEventArgs e)
 {
     if (e.Link == "SayHello")
     {
         MessageBox.Show("Hello you!");
         e.Handled = true;
     }
     else if (e.Link == "ShowSampleForm")
     {
         using (var f = new SampleForm())
         {
             f.ShowDialog();
             e.Handled = true;
         }
     }
 }