Пример #1
0
        static IGeometry makeGeometry(IDrawingBackend backend)
        {
            var geometry = backend.Geometry(gt =>
            {
                gt.Line(5, 5, 75, 35);
                gt.Ellipse(25, 5, 30, 30);
            });

            return(geometry);
        }
Пример #2
0
        static IGeometry makeGeometry(IDrawingBackend backend)
        {
            var geometry = backend.Geometry(gt =>
                {
                    gt.Line(5, 5, 75, 35);
                    gt.Ellipse(25, 5, 30, 30);
                });

            return geometry;
        }
Пример #3
0
 static ITestResultMethod runGeometryTargetTest(
     ITestResultFactory resultFactory,
     IDrawingBackend drawingBackend,
     object instance,
     TestMethod testMethod)
 {
     using (var geometry = drawingBackend.Geometry(target => testMethod.invoke(instance, target, drawingBackend)))
     {
         return(runMethodTest(resultFactory, drawingBackend, testMethod, dt =>
         {
             dt.Fill(color: new Color(0.7, 0.7, 1.0));
             dt.Geometry(geometry);
         }));
     }
 }
Пример #4
0
 static ITestResultMethod runGeometryTargetTest(
     ITestResultFactory resultFactory,
     IDrawingBackend drawingBackend,
     object instance,
     TestMethod testMethod)
 {
     using (var geometry = drawingBackend.Geometry(target => testMethod.invoke(instance, target, drawingBackend)))
     {
         return runMethodTest(resultFactory, drawingBackend, testMethod, dt =>
             {
                 dt.Fill(color: new Color(0.7, 0.7, 1.0));
                 dt.Geometry(geometry);
             });
     }
 }
Пример #5
0
		public static IGeometry Ellipse(this IDrawingBackend backend, double x, double y, double width, double height)
		{
			return backend.Geometry(gt => gt.Ellipse(x, y, width, height));
		}
Пример #6
0
		public static IGeometry RoundedRectangle(this IDrawingBackend backend, double x, double y, double width, double height, double cornerRadius)
		{
			return backend.Geometry(gt => gt.RoundedRectangle(x, y, width, height, cornerRadius));
		}
Пример #7
0
		public static IGeometry Polygon(this IDrawingBackend backend, params double[] coordinatePairs)
		{
			return backend.Geometry(gt => gt.Polygon(coordinatePairs));
		}
Пример #8
0
		public static IGeometry Line(this IDrawingBackend backend, double x1, double y1, double x2, double y2)
		{
			return backend.Geometry(gt => gt.Line(x1, y1, x2, y2));
		}
Пример #9
0
		public static IGeometry Geometry(this IDrawingBackend backend, Action<IGeometryTarget> geometryBuilder)
		{
			var recorder = new GeometryTargetRecorder();
			geometryBuilder(recorder);
			return backend.Geometry(recorder);
		}