public static void AddGeometry(this D2D.GeometrySink sink, Geometry geometry, RectangleF rect) { var geometryGroup = geometry as Jupiter.Media.GeometryGroup; if (geometryGroup != null) { sink.AddGeometryGroup(geometryGroup, rect); } var lineGeometry = geometry as Jupiter.Media.LineGeometry; if (lineGeometry != null) { sink.AddLineGeometry(lineGeometry); } var rectangleGeometry = geometry as Jupiter.Media.RectangleGeometry; if (rectangleGeometry != null) { sink.AddRectangleGeometry(rectangleGeometry); } var ellipseGeometry = geometry as Jupiter.Media.EllipseGeometry; if (ellipseGeometry != null) { sink.AddEllipseGeometry(ellipseGeometry); } var pathGeometry = geometry as Jupiter.Media.PathGeometry; if (pathGeometry != null) { sink.AddPathGeometry(pathGeometry); } }