LongoMatch.Core.Store.Drawables.MultiPoints.GetSelection C# (CSharp) 메소드

GetSelection() 공개 메소드

public GetSelection ( Point p, double pr, bool inMotion = false ) : Selection
p Point
pr double
inMotion bool
리턴 Selection
        public override Selection GetSelection(Point p, double pr, bool inMotion=false)
        {
            Selection s = base.GetSelection (p, pr);
            if (s != null) {
                s.Position = SelectionPosition.All;
            }
            return s;
        }

Usage Example

예제 #1
0
        public void TestSelection()
        {
            Point p1, p2, p3;
            List<Point> l;
            Selection s;

            p1 = new Point (2, 2);
            p2 = new Point (3, 5);
            p3 = new Point (6, 8);
            l = new List<Point> ();
            l.Add (p1);
            l.Add (p2);
            l.Add (p3);

            MultiPoints m = new MultiPoints (l);
            s = m.GetSelection (new Point (3, 5), 1);
            Assert.AreEqual (SelectionPosition.All, s.Position);

            s = m.GetSelection (new Point (0, 5), 1);
            Assert.IsNull (s);
            s = m.GetSelection (new Point (5, 12), 1);
            Assert.IsNull (s);
        }