PageRenderTime 50ms CodeModel.GetById 26ms RepoModel.GetById 0ms app.codeStats 0ms

/Atlassian.Jira/ProjectComponentCollection.cs

https://bitbucket.org/yyo/atlassian.net-sdk-v2.0
C# | 33 lines | 23 code | 3 blank | 7 comment | 0 complexity | d1d0747b976d8c42c52fea710a865b12 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. namespace Atlassian.Jira
  7. {
  8. /// <summary>
  9. /// Collection of project components
  10. /// </summary>
  11. public class ProjectComponentCollection: JiraNamedEntityCollection<ProjectComponent>
  12. {
  13. internal ProjectComponentCollection(string fieldName, Jira jira, string projectKey)
  14. :this(fieldName, jira, projectKey, new List<ProjectComponent>())
  15. {
  16. }
  17. internal ProjectComponentCollection(string fieldName, Jira jira, string projectKey, IList<ProjectComponent> list)
  18. : base(fieldName, jira, projectKey, list)
  19. {
  20. }
  21. /// <summary>
  22. /// Add a component by name
  23. /// </summary>
  24. /// <param name="componentName">Component name</param>
  25. public void Add(string componentName)
  26. {
  27. this.Add(_jira.GetProjectComponents(_projectKey).First(v => v.Name.Equals(componentName, StringComparison.OrdinalIgnoreCase)));
  28. }
  29. }
  30. }