Exemple #1
0
        private static UpComingSchedule ProcessUpcomingItems(string result)
        {
            UpComingSchedule returnType;
            try
            {
                returnType = JsonHelpers.DeserializeJson<List<UpComingSchedule>>(result).First();
            }
            catch (Exception)
            {
                returnType = new UpComingSchedule();
            }

            return returnType;
        }
        private static UpComingViewSchedule ConvertToView(UpComingSchedule input)
        {
            if (input == null) throw new ArgumentNullException("input");
            var output = new UpComingViewSchedule
                             {
                                 Teams = String.Format("{0} vs {1}", input.HomeTeam, input.VisitingTeam),
                                 GameDateTime =
                                     String.Format("{0} {1}", input.StartDateLocal.ToShortDateString(),
                                                   input.StartTimeLocal),
                                 TvInfo = input.TvInfo
                             };

            return output;
        }
Exemple #3
0
        private void UpdateUpComing(UpComingSchedule input)
        {
            if (input == null) throw new ArgumentNullException("input");
            var output = new UpComingViewSchedule
                             {
                                 Teams = String.Format("{0} vs {1}", input.HomeTeam, input.VisitingTeam),
                                 GameDateTime =
                                     String.Format("{0} {1}", input.StartDateLocal.ToShortDateString(),
                                                   input.StartTimeLocal),
                                 TvInfo = input.TvInfo
                             };

            if (!string.IsNullOrWhiteSpace(output.Teams))
            {
                _isolated["UpComing"] = output.Teams;
            }

            string upcoming = null;
            if (_isolated.Contains("UpComing"))
            {
                upcoming = _isolated["UpComing"].ToString();
            }

            string backContent = upcoming;
            UpdateTile("Schedule", backContent);
            NotifyComplete();
        }