/// <summary> /// Initializes a new instance of the <see cref="DismPackageInfo" /> class. /// </summary> /// <param name="packageInfo">A <see cref="DismApi.DismPackageInfo_" /> struct containing data for this object.</param> internal DismPackageInfo(DismApi.DismPackageInfo_ packageInfo) { _packageInfo = packageInfo; CreationTime = _packageInfo.CreationTime; InstallTime = _packageInfo.InstallTime; LastUpdateTime = _packageInfo.LastUpdateTime; CustomProperties = new DismCustomPropertyCollection(_packageInfo.CustomProperty, _packageInfo.CustomPropertyCount); Features = new DismFeatureCollection(_packageInfo.Feature, _packageInfo.FeatureCount); }
/// <summary> /// Initializes a new instance of the DismPackageInfo class. /// </summary> /// <param name="packageInfo">A <see cref="DismApi.DismPackageInfo_"/> struct containing data for this object.</param> internal DismPackageInfo(DismApi.DismPackageInfo_ packageInfo) { _packageInfo = packageInfo; // See if there are any custom properties if (_packageInfo.CustomPropertyCount > 0 && _packageInfo.CustomProperty != IntPtr.Zero) { // Add the items _customProperties.AddRange <DismApi.DismCustomProperty_>(_packageInfo.CustomProperty, (int)_packageInfo.CustomPropertyCount, i => new DismCustomProperty(i)); } // See if there are any features associated with the package if (_packageInfo.FeatureCount > 0 && _packageInfo.Feature != IntPtr.Zero) { // Add the items _features.AddRange <DismApi.DismFeature_>(_packageInfo.Feature, (int)_packageInfo.FeatureCount, i => new DismFeature(i)); } }