예제 #1
0
 public void AddDependency(string id, string version)
 {
     NugetPackageIdentifier[] current = Dependencies;
     NugetPackageIdentifier[] next    = new NugetPackageIdentifier[current.Length + 1];
     current.CopyTo(next, 0);
     next[next.Length - 1] = new NugetPackageIdentifier(id, version);
     Dependencies          = next;
 }
예제 #2
0
 /// <summary>
 /// Adds a dependency. Will not add the dependency if the specified id
 /// is already a dependency regardless of version, use UpdateDependencyVersion
 /// in that case.
 /// </summary>
 /// <param name="id">The identifier.</param>
 /// <param name="version">The version.</param>
 public void AddDependency(string id, string version)
 {
     NugetPackageIdentifier[] current = Dependencies.Where(npi => !npi.Id.Equals(id)).ToArray();
     NugetPackageIdentifier[] next    = new NugetPackageIdentifier[current.Length + 1];
     current.CopyTo(next, 0);
     next[next.Length - 1] = new NugetPackageIdentifier(id, version);
     Dependencies          = next;
 }