Beispiel #1
0
 internal ContentInstallationEntry([NotNull] string source, [CanBeNull] ContentInstallationParams installationParams)
 {
     Source = source;
     _installationParams = installationParams ?? ContentInstallationParams.Default;
     DisplayName         = _installationParams.DisplayName;
     InformationUrl      = _installationParams.InformationUrl;
     Version             = _installationParams.DisplayVersion;
 }
        internal ContentInstallationEntry([NotNull] string source, [CanBeNull] ContentInstallationParams installationParams)
        {
            InstallationParams = installationParams ?? ContentInstallationParams.Default;
            Source             = source;
            AddedDateTime      = DateTime.Now;
            DisplayName        = InstallationParams.DisplayName ?? Source.Split(new[] { '?', '&' }, 2)[0].Split('/', '\\').Last();
            InformationUrl     = InstallationParams.InformationUrl;
            Version            = InstallationParams.Version;

            if (InstallationParams.CupType.HasValue)
            {
                var manager = CupClient.Instance?.GetAssociatedManager(InstallationParams.CupType.Value);
                DisplayUpdateFor = InstallationParams.IdsToUpdate?.Select(x => manager?.GetObjectById(x)?.ToString()).JoinToReadableString();
                if (string.IsNullOrWhiteSpace(DisplayUpdateFor))
                {
                    DisplayUpdateFor = null;
                }

                PreferCleanInstallation = InstallationParams.PreferCleanInstallation;
            }
        }
Beispiel #3
0
 public ContentScanner([NotNull] ContentInstallationParams installationParams)
 {
     _installationParams = installationParams ?? throw new ArgumentNullException(nameof(installationParams));
 }