예제 #1
0
        private bool MouseDownPointAndMouseUpPointsAreFarEnough(Microsoft.Msagl.Drawing.MsaglMouseEventArgs e)
        {
            int    x = e.X; int y = e.Y;
            double dx = (mouseDownScreenPoint.X - x) / viewer.DpiX;
            double dy = (mouseDownScreenPoint.Y - y) / viewer.DpiY;

            return(Math.Sqrt(dx * dx + dy * dy) > this.MouseMoveThreshold / 3);
        }
예제 #2
0
        private void Viewer_MouseDown(object sender, Microsoft.Msagl.Drawing.MsaglMouseEventArgs e)
        {
            if (e != null && e.Clicks > 1 && e.LeftButtonIsPressed && theViewer != null && this.eventStack != null)
            {
                // double-click detected, can access the viewer?
                try
                {
                    var x = theViewer.ObjectUnderMouseCursor;
                    if (x != null && x.DrawingObject != null && x.DrawingObject.UserData != null)
                    {
                        var us = x.DrawingObject.UserData;
                        if (us is AdminShell.Referable)
                        {
                            // make event
                            var refs = new List <AdminShell.Key>();
                            (us as AdminShell.Referable).CollectReferencesByParent(refs);

                            // ok?
                            if (refs.Count > 0)
                            {
                                var evt = new AasxPluginResultEventNavigateToReference();
                                evt.targetReference = AdminShell.Reference.CreateNew(refs);
                                this.eventStack.PushEvent(evt);
                            }
                        }

                        if (us is AdminShell.Reference)
                        {
                            var evt = new AasxPluginResultEventNavigateToReference();
                            evt.targetReference = (us as AdminShell.Reference);
                            this.eventStack.PushEvent(evt);
                        }
                    }
                }
                catch (Exception ex)
                {
                    AdminShellNS.LogInternally.That.SilentlyIgnoredError(ex);
                }
            }
        }
        private void Viewer_MouseDown(object sender, Microsoft.Msagl.Drawing.MsaglMouseEventArgs e)
        {
            if (e != null && e.Clicks > 1 && e.LeftButtonIsPressed && theViewer != null && this.eventStack != null)
            {
                // double-click detected, can access the viewer?
                // ReSharper disable EmptyGeneralCatchClause
                try
                {
                    var x = theViewer.ObjectUnderMouseCursor;
                    if (x != null && x.DrawingObject != null && x.DrawingObject.UserData != null)
                    {
                        var us = x.DrawingObject.UserData;
                        if (us is AdminShell.Referable)
                        {
                            // make event
                            var refs = new List<AdminShell.Key>();
                            (us as AdminShell.Referable).CollectReferencesByParent(refs);

                            // ok?
                            if (refs.Count > 0)
                            {
                                var evt = new AasxPluginResultEventNavigateToReference();
                                evt.targetReference = AdminShell.Reference.CreateNew(refs);
                                this.eventStack.PushEvent(evt);
                            }
                        }

                        if (us is AdminShell.Reference)
                        {
                            var evt = new AasxPluginResultEventNavigateToReference();
                            evt.targetReference = (us as AdminShell.Reference);
                            this.eventStack.PushEvent(evt);
                        }
                    }
                }
                catch { }
                // ReSharper enable EmptyGeneralCatchClause
            }
        }
예제 #4
0
 private void Viewer_MouseMove(object sender, Microsoft.Msagl.Drawing.MsaglMouseEventArgs e)
 {
 }