示例#1
0
        public SectionDetails GetScore()
        {
            SectionDetails details = new SectionDetails(0, new List <string>(), this);

            List <StartupInfo> systemStartups = new List <StartupInfo>();

            // Get current startup infos
            StartupInfo.GetStartupInfos(systemStartups);

            // Create list of strings to contain string representations of startups
            List <string> startups = new List <string>(systemStartups.Count);

            // For each system startup info
            foreach (StartupInfo info in systemStartups)
            {
                // Add string representation to list
                startups.Add(info.ToString());
            }

            // For each startup info config
            foreach (StartupInfo info in StartupInfos)
            {
                // Get string representation of startup info
                // Used to compare against others
                string infoString = info.ToString();

                // If string doesn't exist within list
                if (!startups.Contains(infoString))
                {
                    // Increase score and add to output
                    details.Points++;
                    details.Output.Add(TranslationManager.Translate("Startup", info.Owner, info.Name, info.Command, info.StartupTypeString, info.Location));
                }
            }

            return(details);
        }
示例#2
0
 public void PopulateStartupInfos()
 {
     // Get startup information
     StartupInfo.GetStartupInfos(ConfigurationManager.StartupInfos);
 }