コード例 #1
0
 private float? GetValue(YouTrack.Issue issue)
 {
     var stringValue = GetFieldValue(issue, "Estimation");
     if (string.IsNullOrWhiteSpace(stringValue)) return null;
     var values = JsonConvert.DeserializeObject<int[]>(stringValue);
     if (values.Any()) return values.First();
     return null;
 }
コード例 #2
0
 private string GetFieldValue(YouTrack.Issue issue, string fieldName)
 {
     var item = issue.Field.SingleOrDefault(i => string.Equals(i.Name, fieldName, StringComparison.InvariantCultureIgnoreCase));
     return item != null ? item.Value : null;
 }
コード例 #3
0
 private DateTime? GetTimeStamp(YouTrack.Issue issue)
 {
     var stringValue = GetFieldValue(issue, "resolved");
     if (string.IsNullOrWhiteSpace(stringValue)) return null;
     return Client.Convert(Convert.ToInt64(stringValue));
 }
コード例 #4
0
            public Issue(string lineLabel, YouTrack.Issue issue)
            {
                if (lineLabel == null) throw new ArgumentNullException("lineLabel");
                if (issue == null) throw new ArgumentNullException("issue");
                LineLabel = lineLabel;
                Id = issue.Id;
                Summary = GetFieldValue(issue, "summary");
                Value = GetValue(issue);
                Timestamp = GetTimeStamp(issue);

                var typeData = GetFieldValue(issue, "Type");
                if (!string.IsNullOrWhiteSpace(typeData))
                {
                    var type = JsonConvert.DeserializeObject<string[]>(typeData);
                    Type = type.First();
                }
            }