public void ConvertObjectlistFromNative() { var tableid = new JET_TABLEID { Value = (IntPtr)0x1000 }; var col1 = new JET_COLUMNID { Value = 1 }; var col2 = new JET_COLUMNID { Value = 2 }; var col3 = new JET_COLUMNID { Value = 3 }; var col4 = new JET_COLUMNID { Value = 4 }; var col5 = new JET_COLUMNID { Value = 5 }; var col6 = new JET_COLUMNID { Value = 6 }; var native = new NATIVE_OBJECTLIST() { tableid = tableid.Value, cRecord = 100, columnidobjectname = col1.Value, columnidobjtyp = col2.Value, columnidgrbit = col3.Value, columnidflags = col4.Value, columnidcRecord = col5.Value, columnidcPage = col6.Value, }; var objectlist = new JET_OBJECTLIST(); objectlist.SetFromNativeObjectlist(native); Assert.AreEqual(tableid, objectlist.tableid); Assert.AreEqual(100, objectlist.cRecord); Assert.AreEqual(col1, objectlist.columnidobjectname); Assert.AreEqual(col2, objectlist.columnidobjtyp); Assert.AreEqual(col3, objectlist.columnidgrbit); Assert.AreEqual(col4, objectlist.columnidflags); Assert.AreEqual(col5, objectlist.columnidcRecord); Assert.AreEqual(col6, objectlist.columnidcPage); }
/// <summary> /// Sets the fields of the object from a native JET_OBJECTLIST struct. /// </summary> /// <param name="value"> /// The native objectlist to set the values from. /// </param> internal void SetFromNativeObjectlist(NATIVE_OBJECTLIST value) { this.tableid = new JET_TABLEID { Value = value.tableid }; this.cRecord = checked ((int)value.cRecord); this.columnidobjectname = new JET_COLUMNID { Value = value.columnidobjectname }; this.columnidobjtyp = new JET_COLUMNID { Value = value.columnidobjtyp }; this.columnidgrbit = new JET_COLUMNID { Value = value.columnidgrbit }; this.columnidflags = new JET_COLUMNID { Value = value.columnidflags }; this.columnidcRecord = new JET_COLUMNID { Value = value.columnidcRecord }; this.columnidcPage = new JET_COLUMNID { Value = value.columnidcPage }; }
public void Setup() { this.native = new NATIVE_OBJECTLIST() { tableid = new IntPtr(0x100), cRecord = 100, columnidobjectname = 1, columnidobjtyp = 2, columnidgrbit = 3, columnidflags = 4, columnidcRecord = 5, columnidcPage = 6, }; this.managed = new JET_OBJECTLIST(); this.managed.SetFromNativeObjectlist(this.native); }
/// <summary> /// Sets the fields of the object from a native JET_OBJECTLIST struct. /// </summary> /// <param name="value"> /// The native objectlist to set the values from. /// </param> internal void SetFromNativeObjectlist(NATIVE_OBJECTLIST value) { this.tableid = new JET_TABLEID { Value = value.tableid }; this.cRecord = checked((int)value.cRecord); this.columnidobjectname = new JET_COLUMNID { Value = value.columnidobjectname }; this.columnidobjtyp = new JET_COLUMNID { Value = value.columnidobjtyp }; this.columnidgrbit = new JET_COLUMNID { Value = value.columnidgrbit }; this.columnidflags = new JET_COLUMNID { Value = value.columnidflags }; this.columnidcRecord = new JET_COLUMNID { Value = value.columnidcRecord }; this.columnidcPage = new JET_COLUMNID { Value = value.columnidcPage }; }