PageRenderTime 46ms CodeModel.GetById 20ms RepoModel.GetById 1ms app.codeStats 0ms

/Atlassian.Jira/ProjectVersionCollection.cs

https://bitbucket.org/miketrebilcock/atlassian.net-sdk
C# | 36 lines | 24 code | 5 blank | 7 comment | 0 complexity | 8cf8a4c82f9374e17fed8d2e0323fdfb MD5 | raw file
  1. using System;
  2. using System.Collections.Generic;
  3. using System.Linq;
  4. using System.Text;
  5. using System.Collections.ObjectModel;
  6. using Atlassian.Jira.Remote;
  7. namespace Atlassian.Jira
  8. {
  9. /// <summary>
  10. /// Collection of project versions
  11. /// </summary>
  12. public class ProjectVersionCollection: JiraNamedEntityCollection<ProjectVersion>
  13. {
  14. internal ProjectVersionCollection(string fieldName, Jira jira, string projectKey)
  15. :this(fieldName, jira, projectKey, new List<ProjectVersion>())
  16. {
  17. }
  18. internal ProjectVersionCollection(string fieldName, Jira jira, string projectKey, IList<ProjectVersion> list)
  19. : base(fieldName, jira, projectKey, list)
  20. {
  21. }
  22. /// <summary>
  23. /// Add a version by name
  24. /// </summary>
  25. /// <param name="versionName">Version name</param>
  26. public void Add(string versionName)
  27. {
  28. this.Add(_jira.GetProjectVersions(_projectKey).First(v => v.Name.Equals(versionName, StringComparison.OrdinalIgnoreCase)));
  29. }
  30. }
  31. }