void RemoveDesiredPackageVersion(string packageName) { lock (DesiredPackageVersions) if (DesiredPackageVersions.ContainsKey(packageName)) { DesiredPackageVersions.Remove(packageName); } }
public void SetDesiredPackageVersion(string packageName, string versionData) { if (!(versionData != string.Empty)) { throw new ArgumentOutOfRangeException("versionData != string.Empty"); } // TODO: What about deeper check; is this really a version denotation, etc.. if (versionData == null) { RemoveDesiredPackageVersion(packageName); return; } lock (DesiredPackageVersions) { if (DesiredPackageVersions.ContainsKey(packageName)) { DesiredPackageVersions[packageName] = versionData; } else { DesiredPackageVersions.Add(packageName, versionData); } } }
public string GetDesiredPackageVersion(string packageName) => DesiredPackageVersions.ContainsKey(packageName) ? DesiredPackageVersions[packageName] : null;