示例#1
0
        /// <summary>
        /// Creates a new record object with the requested number of fields.
        /// </summary>
        /// <param name="fieldCount">Required number of fields, which may be 0.
        /// The maximum number of fields in a record is limited to 65535.</param>
        /// <returns>A new record object that can be used with the database.</returns>
        /// <remarks><p>
        /// This method is equivalent to directly calling the <see cref="Record" />
        /// constructor in all cases outside of a custom action context. When in a
        /// custom action session, this method allows creation of a record that can
        /// work with a database other than the session database.
        /// </p><p>
        /// The Record object should be <see cref="InstallerHandle.Close"/>d after use.
        /// It is best that the handle be closed manually as soon as it is no longer
        /// needed, as leaving lots of unused handles open can degrade performance.
        /// </p><p>
        /// Win32 MSI API:
        /// <a href="http://msdn.microsoft.com/library/en-us/msi/setup/msicreaterecord.asp">MsiCreateRecord</a>
        /// </p></remarks>
        public Record CreateRecord(int fieldCount)
        {
            int hRecord = RemotableNativeMethods.MsiCreateRecord((uint)fieldCount, (int)this.Handle);

            return(new Record((IntPtr)hRecord, true, (View)null));
        }
示例#2
0
 /// <summary>
 /// Creates a new record object with the requested number of fields.
 /// </summary>
 /// <param name="fieldCount">Required number of fields, which may be 0.
 /// The maximum number of fields in a record is limited to 65535.</param>
 /// <remarks><p>
 /// The Record object should be <see cref="InstallerHandle.Close"/>d after use.
 /// It is best that the handle be closed manually as soon as it is no longer
 /// needed, as leaving lots of unused handles open can degrade performance.
 /// </p><p>
 /// Win32 MSI API:
 /// <a href="http://msdn.microsoft.com/library/en-us/msi/setup/msicreaterecord.asp">MsiCreateRecord</a>
 /// </p></remarks>
 public Record(int fieldCount)
     : this((IntPtr)RemotableNativeMethods.MsiCreateRecord((uint)fieldCount, 0), true, (View)null)
 {
 }