public static void FillRectangle(this ID2D1DeviceContext context, D2D_RECT_F rect, ID2D1Brush brush) { if (context == null) { throw new ArgumentNullException(nameof(context)); } if (brush == null) { throw new ArgumentNullException(nameof(brush)); } context.FillRectangle(ref rect, brush); }