-
Notifications
You must be signed in to change notification settings - Fork 1.1k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Implement GetLicenseContents() method for getting repository's licens…
…e info
- Loading branch information
Showing
6 changed files
with
168 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,44 @@ | ||
using System.Diagnostics; | ||
using System.Globalization; | ||
|
||
namespace Octokit | ||
{ | ||
[DebuggerDisplay("{DebuggerDisplay,nq}")] | ||
public class RepositoryLicense : LicenseMetadata | ||
{ | ||
public RepositoryLicense( | ||
string key, | ||
string name, | ||
string spdxId, | ||
string url, | ||
bool featured) : base(key, name, url) | ||
{ | ||
Ensure.ArgumentNotNull(spdxId, "spdxId"); | ||
|
||
SpdxId = spdxId; | ||
Featured = featured; | ||
} | ||
|
||
public RepositoryLicense() | ||
{ | ||
} | ||
|
||
/// <summary> | ||
/// SPDX license identifier. | ||
/// </summary> | ||
public string SpdxId { get; protected set; } | ||
|
||
/// <summary> | ||
/// Whether the license is one of the licenses featured on https://choosealicense.com | ||
/// </summary> | ||
public bool Featured { get; protected set; } | ||
|
||
internal override string DebuggerDisplay | ||
{ | ||
get | ||
{ | ||
return string.Format(CultureInfo.InvariantCulture, "{0} Featured: {1}", base.DebuggerDisplay, Featured); | ||
} | ||
} | ||
} | ||
} |