public RectangleValidator( RECT bounds, Color penColor, Color brushColor, int penWidth = 1, Gdi32.PS penStyle = default, Gdi32.R2 rop2 = Gdi32.R2.COPYPEN, Gdi32.BKMODE backgroundMode = Gdi32.BKMODE.TRANSPARENT, Gdi32.BS brushStyle = default, Flags validate = default) { _bounds = bounds; _brushColor = brushColor; _brushStyle = brushStyle; _penWidth = penWidth; _penColor = penColor; _penStyle = penStyle; _rop2 = rop2; _backgroundMode = backgroundMode; if (validate != default) { _validate = validate; return; } // Default values for all of these are valid expectations so we always turn them on. _validate = Flags.Bounds | Flags.PenStyle | Flags.BrushStyle; if (penWidth != 0) { _validate |= Flags.PenWidth; } if (!penColor.IsEmpty) { _validate |= Flags.PenColor; } if (!brushColor.IsEmpty) { _validate |= Flags.BrushColor; } if (backgroundMode != default) { _validate |= Flags.BackgroundMode; } if (_rop2 != default) { _validate |= Flags.RopMode; } }
internal static IEmfValidator Rectangle( RECT bounds, Color penColor, Color brushColor, int penWidth = 1, Gdi32.PS penStyle = default, Gdi32.R2 rop2 = Gdi32.R2.COPYPEN, Gdi32.BKMODE backgroundMode = Gdi32.BKMODE.TRANSPARENT, Gdi32.BS brushStyle = default, RectangleValidator.Flags validate = default) => new RectangleValidator( bounds, penColor, brushColor, penWidth, penStyle, rop2, backgroundMode, brushStyle, validate);
public BrushValidator(Color brushColor, Gdi32.BS brushStyle) { _brushColor = brushColor; _brushStyle = brushStyle; }
public BrushStyleValidator(Gdi32.BS brushStyle) => _brushStyle = brushStyle;
internal static IStateValidator BrushStyle(Gdi32.BS brushStyle) => new BrushStyleValidator(brushStyle);
internal static IStateValidator Brush(Color brushColor, Gdi32.BS brushStyle) => new BrushValidator(brushColor, brushStyle);