示例#1
0
		public void BasicTest ()
		{
			SW.Point nonEmptyPoint =
				new SW.Point (1,2);
			SW.Point emptyPoint =
				new SW.Point (double.NegativeInfinity, double.NegativeInfinity);

			DC.Point nonEmptyCorePoint = new DC.Point (nonEmptyPoint);
			Assert.AreEqual (nonEmptyPoint.X,
			                 nonEmptyCorePoint.x,
			                 "x from Point");
			Assert.AreEqual (nonEmptyPoint.Y,
			                 nonEmptyCorePoint.y,
			                 "y from Point");

			DC.Point emptyCorePoint = new DC.Point (emptyPoint);
			Assert.AreEqual (emptyPoint.X,
			                 emptyCorePoint.x,
			                 "x from Point");
			Assert.AreEqual (emptyPoint.Y,
			                 emptyCorePoint.y,
			                 "y from Point");

			nonEmptyCorePoint.x = 5;
			Assert.AreEqual (5,
			                 nonEmptyCorePoint.x,
			                 "x set manually");
			nonEmptyCorePoint.y = 6;
			Assert.AreEqual (6,
			                 nonEmptyCorePoint.y,
			                 "y set manually");
		}
示例#2
0
        public void BasicTest()
        {
            SW.Point nonEmptyPoint =
                new SW.Point(1, 2);
            SW.Point emptyPoint =
                new SW.Point(double.NegativeInfinity, double.NegativeInfinity);

            DC.Point nonEmptyCorePoint = new DC.Point(nonEmptyPoint);
            Assert.AreEqual(nonEmptyPoint.X,
                            nonEmptyCorePoint.x,
                            "x from Point");
            Assert.AreEqual(nonEmptyPoint.Y,
                            nonEmptyCorePoint.y,
                            "y from Point");

            DC.Point emptyCorePoint = new DC.Point(emptyPoint);
            Assert.AreEqual(emptyPoint.X,
                            emptyCorePoint.x,
                            "x from Point");
            Assert.AreEqual(emptyPoint.Y,
                            emptyCorePoint.y,
                            "y from Point");

            nonEmptyCorePoint.x = 5;
            Assert.AreEqual(5,
                            nonEmptyCorePoint.x,
                            "x set manually");
            nonEmptyCorePoint.y = 6;
            Assert.AreEqual(6,
                            nonEmptyCorePoint.y,
                            "y set manually");
        }
示例#3
0
        public ITextPatternRange RangeFromPoint(Point screenLocation)
        {
            DC.Point pt        = new DC.Point(screenLocation);
            string   rangePath = null;

            try {
                rangePath = pattern.RangePathFromPoint(pt);
            } catch (Exception ex) {
                throw DbusExceptionTranslator.Translate(ex);
            }
            return(GetTextPatternRange(rangePath));
        }
示例#4
0
        public string RangePathFromPoint(DC.Point screenLocation)
        {
            var textRangeProvider = provider.RangeFromPoint(new SW.Point(screenLocation.x, screenLocation.y));

            return(GetOrCreateTextRange(textRangeProvider));
        }
示例#5
0
		public ITextPatternRange RangeFromPoint (Point screenLocation)
		{
			DC.Point pt = new DC.Point (screenLocation);
			string rangePath = null;
			try {
				rangePath = pattern.RangePathFromPoint (pt);
			} catch (Exception ex) {
				throw DbusExceptionTranslator.Translate (ex);
			}
			return GetTextPatternRange (rangePath);
		}