コード例 #1
0
ファイル: MainView.cs プロジェクト: rzeczuchy/rzeczuchyTrack
        public MainView()
        {
            ui = new UIStateHandler();

            entryList = new TimeEntryList(new Point(1, 1), new Point(Console.BufferWidth - 2, 21), ui);
            ui.AddState(entryList);
            ui.Focused = entryList;
        }
コード例 #2
0
        internal static TimeEntryList getTimeEntrieslist(HttpResponseMessage responce)
        {
            var timeEntryList = new TimeEntryList();
            var jsonObj       = JsonConvert.DeserializeObject <Dictionary <string, object> >(responce.Content.ReadAsStringAsync().Result);

            if (jsonObj.ContainsKey("time_entries"))
            {
                var timeEntriesArray = JsonConvert.DeserializeObject <List <object> >(jsonObj["time_entries"].ToString());
                foreach (var timeEntryObj in timeEntriesArray)
                {
                    var timeEntry = new TimeEntry();
                    timeEntry = JsonConvert.DeserializeObject <TimeEntry>(timeEntryObj.ToString());
                    timeEntryList.Add(timeEntry);
                }
            }
            if (jsonObj.ContainsKey("page_context"))
            {
                var pageContext = new PageContext();
                pageContext = JsonConvert.DeserializeObject <PageContext>(jsonObj["page_context"].ToString());
                timeEntryList.page_context = pageContext;
            }
            return(timeEntryList);
        }
コード例 #3
0
 internal static TimeEntryList getTimeEntrieslist(HttpResponseMessage responce)
 {
     var timeEntryList = new TimeEntryList();
     var jsonObj = JsonConvert.DeserializeObject<Dictionary<string, object>>(responce.Content.ReadAsStringAsync().Result);
     if (jsonObj.ContainsKey("time_entries"))
     {
         var timeEntriesArray = JsonConvert.DeserializeObject<List<object>>(jsonObj["time_entries"].ToString());
         foreach(var timeEntryObj in timeEntriesArray)
         {
             var timeEntry = new TimeEntry();
             timeEntry = JsonConvert.DeserializeObject<TimeEntry>(timeEntryObj.ToString());
             timeEntryList.Add(timeEntry);
         }
     }
     if (jsonObj.ContainsKey("page_context"))
     {
         var pageContext = new PageContext();
         pageContext = JsonConvert.DeserializeObject<PageContext>(jsonObj["page_context"].ToString());
         timeEntryList.page_context = pageContext;
     }
     return timeEntryList;
 }
コード例 #4
0
 public async Task<TimeEntryList.response> TimeEntryList(TimeEntryList.request request, CancellationToken? token = null)
 {
     return await SendAsync<TimeEntryList.response>(request.ToXmlString(), token.GetValueOrDefault(CancellationToken.None));
 }