public override unsafe void Validate(ref EmfRecord record, DeviceContextState state, out bool complete)
        {
            base.Validate(ref record, state, out _);

            // We're only checking one LineTo record, so this call completes our work.
            complete = true;

            EMRPOINTRECORD *lineTo = record.LineToRecord;

            if (_from.HasValue)
            {
                Assert.Equal(_from.Value, state.BrushOrigin);
            }

            if (_to.HasValue)
            {
                Assert.Equal(_to.Value, lineTo->point);
            }
        }
Пример #2
0
        public unsafe void Validate(ref EmfRecord record, DeviceContextState state, out bool complete)
        {
            // We're only checking one TextOut record, so this call completes our work.
            complete = true;

            EMRPOINTRECORD *lineTo = record.LineToRecord;

            if (_validate.HasFlag(Flags.From))
            {
                Assert.Equal(_from, state.BrushOrigin);
            }

            if (_validate.HasFlag(Flags.To))
            {
                Assert.Equal(_to, lineTo->point);
            }

            if (_validate.HasFlag(Flags.PenColor))
            {
                Assert.Equal((COLORREF)_penColor, state.SelectedPen.lopnColor);
            }

            if (_validate.HasFlag(Flags.PenWidth))
            {
                Assert.Equal(_penWidth, state.SelectedPen.lopnWidth.X);
            }

            if (_validate.HasFlag(Flags.PenStyle))
            {
                Assert.Equal(_penStyle, state.SelectedPen.lopnStyle);
            }

            if (_validate.HasFlag(Flags.BackgroundMode))
            {
                Assert.Equal(_backgroundMode, state.BackgroundMode);
            }

            if (_validate.HasFlag(Flags.RopMode))
            {
                Assert.Equal(_rop2, state.Rop2Mode);
            }
        }