public static void ShouldContain(this string actual, string expected, [InstantHandle] Func<string> customMessage, Case caseSensitivity) { actual.AssertAwesomely( v => (caseSensitivity == Case.Sensitive) ? Is.StringContainingUsingCaseSensitivity(v, expected) : Is.StringContainingIgnoreCase(v, expected), actual.Clip(100, "..."), expected, caseSensitivity, customMessage); }
public static void ClipRectangle(this Context g, Rectangle r) { g.MoveTo (r.X, r.Y); g.LineTo (r.X + r.Width, r.Y); g.LineTo (r.X + r.Width, r.Y + r.Height); g.LineTo (r.X, r.Y + r.Height); g.LineTo (r.X, r.Y); g.Clip (); }
public static void ShouldContain(this string actual, string expected) { actual.AssertAwesomely(v => Is.StringContainingIgnoreCase(v, expected), actual.Clip(100), expected); }
public static void RenderTiled (this Cairo.Context self, Gdk.Pixbuf source, Gdk.Rectangle area, Gdk.Rectangle clip, double opacity = 1) { Gdk.CairoHelper.SetSourcePixbuf (self, source, area.X, area.Y); //NOTE: Mono.Cairo.Context.Pattern returns an object than cannot be safely disposed, so P/Invoke directly var pattern = cairo_get_source (self.Handle); cairo_pattern_set_extend (pattern, CairoExtend.CAIRO_EXTEND_REPEAT); self.Rectangle (clip.ToCairoRect ()); self.Clip (); self.PaintWithAlpha (opacity); self.ResetClip (); }
public static void RenderTiled (this Cairo.Context self, Gdk.Pixbuf source, Gdk.Rectangle area, Gdk.Rectangle clip, double opacity = 1) { Gdk.CairoHelper.SetSourcePixbuf (self, source, area.X, area.Y); cairo_pattern_set_extend (self.Pattern.Pointer, CairoExtend.CAIRO_EXTEND_REPEAT); self.Rectangle (clip.ToCairoRect ()); self.Clip (); self.PaintWithAlpha (opacity); self.ResetClip (); }
public static void Clear (this Context g, Rectangle roi) { g.Save (); g.Rectangle (roi.X, roi.Y, roi.Width, roi.Height); g.Clip (); g.Operator = Operator.Clear; g.Paint (); g.Restore (); }
public static void BlendSurface (this Context g, Surface src, Rectangle roi, BlendMode mode = BlendMode.Normal, double opacity = 1.0) { g.Save (); g.Rectangle (roi); g.Clip (); g.SetBlendMode (mode); g.SetSourceSurface (src, 0, 0); g.PaintWithAlpha (opacity); g.Restore (); }