void DrawPattern (CGContext context) { var start = new sd.PointF(0, 0); var end = start + sectionSize; context.ClipToRect(sd.RectangleF.Inflate (new sd.RectangleF(start, tileSize), 4, 4)); if (Wrap == GradientWrapMode.Reflect) { for (int i = 0; i < 2; i ++) { context.DrawLinearGradient (Gradient, start, end, 0); context.DrawLinearGradient (InverseGradient, end, end + sectionSize, 0); start = start + sectionSize + sectionSize; end = end + sectionSize + sectionSize; } } else { for (int i = 0; i < 2; i ++) { context.DrawLinearGradient (Gradient, start, end, 0); start = start + sectionSize; end = end + sectionSize; } } }