示例#1
0
        private SettingsContainer MakeSettings()
        {
            var minPackageAge = DurationParser.Parse(MinimumPackageAge);

            if (!minPackageAge.HasValue)
            {
                minPackageAge = TimeSpan.Zero;
                Console.WriteLine($"Min package age '{MinimumPackageAge}' could not be parsed");
            }

            var settings = new SettingsContainer
            {
                ModalSettings = new ModalSettings(),
                UserSettings  = new UserSettings
                {
                    AllowedChange     = AllowedChange,
                    NuGetSources      = NuGetSources,
                    MinimumPackageAge = minPackageAge.Value,
                    PackageIncludes   = SettingsParser.ParseRegex(Include, nameof(Include)),
                    PackageExcludes   = SettingsParser.ParseRegex(Exclude, nameof(Exclude)),
                }
            };

            PopulateSettings(settings);
            return(settings);
        }