PageRenderTime 39ms CodeModel.GetById 18ms RepoModel.GetById 0ms app.codeStats 0ms

/Atlassian.Jira/Remote/ExtensionMethods.cs

https://bitbucket.org/yyo/atlassian.net-sdk-v2.0
C# | 51 lines | 31 code | 5 blank | 15 comment | 0 complexity | a0eebfccd11027bd2962124cc0aeb582 MD5 | raw file
  1. using System;
  2. using System.Collections.Generic;
  3. using System.Linq;
  4. using System.Text;
  5. using System.Reflection;
  6. namespace Atlassian.Jira.Remote
  7. {
  8. public static class ExtensionMethods
  9. {
  10. /// <summary>
  11. /// Create a new RemoteIssue based on the information in a given issue
  12. /// </summary>
  13. public static RemoteIssue ToRemote(this Issue issue)
  14. {
  15. return issue.ToRemote();
  16. }
  17. /// <summary>
  18. /// Create a new Issue from a RemoteIssue
  19. /// </summary>
  20. public static Issue ToLocal(this RemoteIssue remoteIssue, Jira jira = null)
  21. {
  22. return new Issue(jira, remoteIssue);
  23. }
  24. /// <summary>
  25. /// Create a new Attachment from a RemoteAttachment
  26. /// </summary>
  27. public static Attachment ToLocal(this RemoteAttachment remoteAttachment, Jira jira, IWebClient webClient)
  28. {
  29. return new Attachment(jira, webClient, remoteAttachment);
  30. }
  31. /// <summary>
  32. /// Creates a new Version from RemoteVersion
  33. /// </summary>
  34. public static ProjectVersion ToLocal(this RemoteVersion remoteVersion)
  35. {
  36. return new ProjectVersion(remoteVersion);
  37. }
  38. /// <summary>
  39. /// Creates a new Component from RemoteComponent
  40. /// </summary>
  41. public static ProjectComponent ToLocal(this RemoteComponent remoteComponent)
  42. {
  43. return new ProjectComponent(remoteComponent);
  44. }
  45. }
  46. }