コード例 #1
0
        public GitHubRelease Deserialize(IDictionary <string, object> dictionary)
        {
            if (dictionary == null)
            {
                throw new ArgumentNullException("dictionary");
            }

            GitHubRelease release = new GitHubRelease();

            release.Name         = dictionary.ReadValue <string>("name");
            release.TagName      = dictionary.ReadValue <string>("tag_name");
            release.Body         = dictionary.ReadValue <string>("body");
            release.HtmlUrl      = dictionary.ReadValue <string>("html_url");
            release.IsDraft      = dictionary.ReadValue <bool>("draft");
            release.IsPreRelease = dictionary.ReadValue <bool>("prerelease");
            if (dictionary.ContainsKey("created_at"))
            {
                release.CreatedAt = dictionary.ReadValue <DateTime>("created_at");
            }
            if (dictionary.ContainsKey("published_at"))
            {
                release.PublishedAt = dictionary.ReadValue <DateTime>("published_at");
            }

            return(release);
        }
コード例 #2
0
 public UpdateWindow(GitHubRelease lastestVersion, string currentVersion)
     : this()
 {
     _lastestRelease         = lastestVersion;
     txtVersions.DataContext = new
     {
         CurrentVersion = currentVersion,
         LatestVersion  = lastestVersion.TagName.TrimStart('v', 'V')
     };
 }
コード例 #3
0
 public IDictionary <string, object> Serialize(GitHubRelease obj)
 {
     throw new NotImplementedException();
 }