Exemplo n.º 1
0
        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;
            }
        }
Exemplo n.º 2
0
 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;
 }
Exemplo n.º 4
0
 public BrushStyleValidator(Gdi32.BS brushStyle) => _brushStyle = brushStyle;
Exemplo n.º 5
0
 internal static IStateValidator BrushStyle(Gdi32.BS brushStyle) => new BrushStyleValidator(brushStyle);
Exemplo n.º 6
0
 internal static IStateValidator Brush(Color brushColor, Gdi32.BS brushStyle)
 => new BrushValidator(brushColor, brushStyle);