public void Load(BinaryReader reader)
        {
            // Load system's features
            WindowsFeature.GetWindowsFeatures(ConfigurationManager.Features);

            // Get number of features
            int count = reader.ReadInt32();

            for (int i = 0; i < count; i++)
            {
                // Get feature info
                WindowsFeature feature = WindowsFeature.Parse(reader);

                // Search for feature in list
                WindowsFeature match = ConfigurationManager.Features.FirstOrDefault(x => x.Name == feature.Name);

                // If match was found
                if (match != null)
                {
                    // Copy info to shown WindowsFeature
                    match.Installed = feature.Installed;
                    match.IsScored  = feature.IsScored;
                }
                else
                {
                    // Add feature to list
                    ConfigurationManager.Features.Add(feature);
                }
            }
        }
Exemple #2
0
        public void Load(BinaryReader reader)
        {
            // Get number of features
            int count = reader.ReadInt32();

            for (int i = 0; i < count; i++)
            {
                // Get feature info
                WindowsFeature feature = WindowsFeature.Parse(reader);

                // If feature isn't scored, skip
                if (!feature.IsScored)
                {
                    continue;
                }

                // Add feature to scored list
                ScoredFeatures.Add(feature);
            }
        }