CCNet.Build.SetupPackages.PackageChecker.ParseCustomVersions C# (CSharp) Méthode

ParseCustomVersions() private static méthode

private static ParseCustomVersions ( string customVersions ) : Version>.Dictionary
customVersions string
Résultat Version>.Dictionary
		private static Dictionary<string, Version> ParseCustomVersions(string customVersions)
		{
			var result = new Dictionary<string, Version>();
			if (String.IsNullOrEmpty(customVersions))
				return result;

			foreach (var item in customVersions.Split('|'))
			{
				if (!item.Contains('+'))
				{
					// empty version behavior depends on the package type
					// for local packages, it means they should be pinned to its current version
					// for remote packages, it means they should be updated to their latest version
					result.Add(item, null);
					continue;
				}

				var parts = item.Split('+');
				var name = parts[0];
				var version = parts[1];
				result.Add(name, new Version(version));
			}

			return result;
		}