/// <summary>
 /// Sets the fields of the object from a native JET_ENUMCOLUMN struct.
 /// </summary>
 /// <param name="value">
 /// The native enumcolumn to set the values from.
 /// </param>
 internal void SetFromNativeEnumColumnValue(NATIVE_ENUMCOLUMNVALUE value)
 {
     this.itagSequence = checked((int) value.itagSequence);
     this.err = (JET_wrn) value.err;
     this.cbData = checked((int) value.cbData);
     this.pvData = value.pvData;
 }
Example #2
0
 /// <summary>
 /// Sets the fields of the object from a native JET_ENUMCOLUMN struct.
 /// </summary>
 /// <param name="value">
 /// The native enumcolumn to set the values from.
 /// </param>
 internal void SetFromNativeEnumColumnValue(NATIVE_ENUMCOLUMNVALUE value)
 {
     this.itagSequence = checked ((int)value.itagSequence);
     this.err          = (JET_wrn)value.err;
     this.cbData       = checked ((int)value.cbData);
     this.pvData       = value.pvData;
 }
        public void TestConversion()
        {
            var native = new NATIVE_ENUMCOLUMNVALUE
            {
                cbData = 1,
                err = (int) JET_wrn.ColumnTruncated,
                itagSequence = 2,
                pvData = new IntPtr(3),
            };

            var managed = new JET_ENUMCOLUMNVALUE();
            managed.SetFromNativeEnumColumnValue(native);

            Assert.AreEqual(1, managed.cbData);
            Assert.AreEqual(JET_wrn.ColumnTruncated, managed.err);
            Assert.AreEqual(2, managed.itagSequence);
            Assert.AreEqual(new IntPtr(3), managed.pvData);
        }