/// <summary>
        /// Always called after parsing is done (full or incremental)
        /// </summary>
        public override void UpdateCachedChildren()
        {
            RuleSets.Clear();
            CustomProperties.Clear();

            foreach (ParseItem child in Children)
            {
                if (child is RuleSet)
                {
                    RuleSets.Add((RuleSet)child);

                    if (((RuleSet)child).Block != null)
                    {
                        IEnumerable <Declaration> childCustomDecls = ((RuleSet)child).Block.CustomProperties;
                        CustomProperties.AddRange(childCustomDecls);
                    }
                }
            }

            // Don't cache the curly braces for the root stylesheet
            if (IsNestedBlock)
            {
                base.UpdateCachedChildren();
            }
        }
Exemple #2
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));
            }
        }
Exemple #3
0
        /// <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;

            // 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));
            }
        }