Exemple #1
0
        public override bool OnPointerMove(AnnContainer sender, AnnPointerEventArgs e)
        {
            bool handled = false;

            if (TargetObject != null && HasStarted)
            {
                LeadPointD pt = ClipPoint(e.Location, ClipRectangle);

                if (!LeadPoint.Equals(pt, _end))
                {
                    _end = pt;
                    LeadPointCollection points = TargetObject.Points;

                    if (points.Count > 1)
                    {
                        if (_clickCount % 2 != 0)
                        {
                            points[points.Count - 1] = pt; // end point
                        }
                    }

                    AnnIntersectionPointObject intersectionPointObject = TargetObject as AnnIntersectionPointObject;
                    if (intersectionPointObject != null)
                    {
                        intersectionPointObject.IntersectionInsideContainer = ClipRectangle.ContainsPoint(intersectionPointObject.IntersectionPoint);
                    }

                    Working();
                }

                handled = true;
            }

            return(handled);
        }
        public override LeadPointD[] GetThumbLocations()
        {
            LeadPointCollection pointsCollection = TargetObject.Points;

            LeadPointD[] points = new LeadPointD[] { pointsCollection[0], pointsCollection[1] };
            return(points);
        }
Exemple #3
0
        public override bool OnPointerUp(AnnContainer sender, AnnPointerEventArgs e)
        {
            LeadPointCollection points = TargetObject.Points;

            if (_clickCount > 3)
            {
                points.Add(_end); //we want to add  point at the end to infrom us that drawing finished
                EndWorking();
            }

            return(true);
        }
Exemple #4
0
        public override bool OnPointerUp(AnnContainer sender, AnnPointerEventArgs e)
        {
            AnnMidlineObject    midlineObject = TargetObject as AnnMidlineObject;
            LeadPointCollection points        = midlineObject.Points;

            if (ClickCount > 1)
            {
                EndWorking();
            }

            return(true);
        }
        public override LeadPointD[] GetThumbLocations()
        {
            LeadPointCollection pointsCollection = TargetObject.Points;

            if (pointsCollection.Count == 2) // Snap Point Object
            {
                return(pointsCollection.ToArray());
            }
            else // Midline Object
            {
                return(new LeadPointD[] { pointsCollection[0], pointsCollection[1], pointsCollection[2], pointsCollection[3] });
            }
        }
Exemple #6
0
        public override bool OnPointerDown(AnnContainer sender, AnnPointerEventArgs e)
        {
            bool handled = base.OnPointerDown(sender, e);

            if (e.Button != AnnMouseButton.Left)
            {
                return(handled);
            }

            _clickCount++;

            if (e.Button == AnnMouseButton.Left)
            {
                LeadPointD _begin = ClipPoint(e.Location, ClipRectangle);
                _end = _begin;

                LeadPointCollection points = TargetObject.Points;

                if (_clickCount == 1)
                {
                    points.Add(_begin);
                    points.Add(_end);
                }

                else if (_clickCount % 2 != 0)
                {
                    points.Add(_begin);
                    points.Add(_end);
                }

                StartWorking();
                handled = true;
            }

            return(handled);
        }