コード例 #1
0
        /// <summary>
        /// Initializes a new instance of the <see cref="DismFeatureInfo"/> class.
        /// </summary>
        /// <param name="featureInfo">A <see cref="DismApi.DismFeatureInfo_"/> struct from the native DismApi.</param>
        internal DismFeatureInfo(DismApi.DismFeatureInfo_ featureInfo)
        {
            // Save a reference to the native struct
            _featureInfo = featureInfo;

            // See if there are any custom properties to load
            if (_featureInfo.CustomPropertyCount > 0 && _featureInfo.CustomProperty != IntPtr.Zero)
            {
                // Add the items
                CustomProperties.AddRange <DismApi.DismCustomProperty_>(_featureInfo.CustomProperty, (int)_featureInfo.CustomPropertyCount, i => new DismCustomProperty(i));
            }
        }
コード例 #2
0
        /// <summary>
        /// Initializes a new instance of the <see cref="DismFeatureInfo" /> class.
        /// </summary>
        /// <param name="featureInfoPtr">A pointer to a <see cref="DismApi.DismFeatureInfo_" /> struct.</param>
        internal DismFeatureInfo(IntPtr featureInfoPtr)
        {
            _featureInfo = featureInfoPtr.ToStructure <DismApi.DismFeatureInfo_>();

            CustomProperties = new DismCustomPropertyCollection(_featureInfo.CustomProperty, _featureInfo.CustomPropertyCount);
        }