예제 #1
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;

            EMREXTTEXTOUTW *textOut = record.ExtTextOutWRecord;

            if (_validate.HasFlag(Flags.Text))
            {
                Assert.Equal(_text, textOut->emrtext.GetString().ToString());
            }

            if (_validate.HasFlag(Flags.MapMode))
            {
                Assert.Equal(_mapMode, state.MapMode);
            }

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

            if (_validate.HasFlag(Flags.TextColor))
            {
                Assert.Equal((COLORREF)_textColor, state.TextColor);
            }

            if (_validate.HasFlag(Flags.FontFace))
            {
                Assert.Equal(_fontFace, state.SelectedFont.FaceName.ToString());
            }
        }
예제 #2
0
        public override unsafe void Validate(ref EmfRecord record, DeviceContextState state, out bool complete)
        {
            base.Validate(ref record, state, out _);

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

            EMREXTTEXTOUTW *textOut = record.ExtTextOutWRecord;

            if (_text != null)
            {
                Assert.Equal(_text, textOut->emrtext.GetText().ToString());
            }

            if (_bounds.HasValue)
            {
                Assert.Equal(_bounds.Value, (Rectangle)textOut->rclBounds);
            }
        }