Example #1
0
 /// <summary>
 /// Sets only the output fields of the object from a native JET_COLUMNCREATE struct,
 /// specifically <see cref="columnid"/> and <see cref="err"/>.
 /// </summary>
 /// <param name="value">
 /// The native columncreate to set the values from.
 /// </param>
 internal void SetFromNativeColumnCreate(NATIVE_COLUMNCREATE value)
 {
     this.columnid = new JET_COLUMNID {
         Value = value.columnid
     };
     this.err = (JET_err)value.err;
 }
Example #2
0
        /// <summary>
        /// Returns the unmanaged columncreate that represents this managed class.
        /// <see cref="szColumnName"/>, <see cref="pvDefault"/>, <see cref="columnid"/>,
        /// and <see cref="err"/> are not converted.
        /// </summary>
        /// <returns>A native (interop) version of the JET_COLUMNCREATE.</returns>
        internal NATIVE_COLUMNCREATE GetNativeColumnCreate()
        {
            var native = new NATIVE_COLUMNCREATE();

            native.cbStruct = checked ((uint)Marshal.SizeOf(typeof(NATIVE_COLUMNCREATE)));

            // columncreate.szColumnName is converted at pinvoke time.
            native.szColumnName = IntPtr.Zero;
            native.coltyp       = (uint)this.coltyp;
            native.cbMax        = (uint)this.cbMax;
            native.grbit        = (uint)this.grbit;

            // columncreate.pvDefault is converted at pinvoke time.
            native.pvDefault = IntPtr.Zero;

            native.cbDefault = checked ((uint)this.cbDefault);

            native.cp = (uint)this.cp;

            return(native);
        }