Ejemplo n.º 1
0
        override protected void OnMouseDown(MouseEventArgs mea)
        {
            base.OnMouseDown(mea);                      // allow base to process first
            _MousePosition = new Point(mea.X, mea.Y);

            if (MouseDownRubberBand(mea))
            {
                return;
            }

            HitListEntry hle = cpim.GetHitListEntry(mea, cp.Zoom);

            cpim.SetHitListCursor(hle);                 // set the cursor based on the hit list entry

            if (mea.Button != MouseButtons.Left || hle == null)
            {
                return;
            }

            if (hle.PageItem.HyperLink != null)
            {
                RdlViewer rv      = this.Parent as RdlViewer;
                bool      bInvoke = true;
                if (rv != null)
                {
                    HyperlinkEventArgs hlea = new HyperlinkEventArgs(hle.PageItem.HyperLink);
                    rv.InvokeHyperlink(hlea);     // reset any mousemove
                    bInvoke = !hlea.Cancel;
                }
                try
                {
                    if (bInvoke)
                    {
                        System.Diagnostics.Process.Start(hle.PageItem.HyperLink);
                    }
                }
                catch (Exception ex)
                {
                    MessageBox.Show(string.Format("Unable to link to {0}{1}{2}",
                                                  hle.PageItem.HyperLink, Environment.NewLine, ex.Message), "HyperLink Error");
                }
            }
        }