Beispiel #1
0
        /// <summary>
        /// Instantiate a new SummaryInformation class from a database file.
        /// </summary>
        /// <param name="databaseFile">The database file.</param>
        public SummaryInformation(string databaseFile)
        {
            if (null == databaseFile)
            {
                throw new ArgumentNullException("databaseFile");
            }

            uint handle = 0;
            int  error  = MsiInterop.MsiGetSummaryInformation(0, databaseFile, 0, ref handle);

            if (0 != error)
            {
                throw new MsiException(error);
            }
            this.Handle = handle;
        }
Beispiel #2
0
        /// <summary>
        /// Instantiate a new SummaryInformation class from an open database.
        /// </summary>
        /// <param name="db">Database to retrieve summary information from.</param>
        public SummaryInformation(Database db)
        {
            if (null == db)
            {
                throw new ArgumentNullException("db");
            }

            uint handle = 0;
            int  error  = MsiInterop.MsiGetSummaryInformation(db.Handle, null, 0, ref handle);

            if (0 != error)
            {
                throw new MsiException(error);
            }
            this.Handle = handle;
        }