Ejemplo n.º 1
0
        // Fills out the schedule for a given day
        public Element MakeSchedule(DateTime d)
        {                                                                                        // Added .ToString/Convert.ToDateTime
                                                                                                 // to avoid System.ExecutionEngineException: Attempting to JIT compile method 'System.Collections.Generic.GenericEqualityComparer`1<System.DateTime>:.ctor ()' while running with --aot-only.

            var sections = from s in MonkeySpace.Core.ConferenceManager.Sessions.Values.ToList() //AppDelegate.ConferenceData.Sessions
                           where s.Start.Day == d.Day
                           orderby s.Start ascending
                           group s by s.Start.ToString() into g
                           select new Section(MakeCaption("", Convert.ToDateTime(g.Key)))
            {
                from hs in g
                select(Element) new SessionElement(hs)
            };

            var root = new CustomRootElement(FormatDate(d, DateTime.Now));

            foreach (var s in sections)
            {
                root.Add(s);
            }
            return(root);
        }
Ejemplo n.º 2
0
        RootElement GenerateRoot()
        {
            var favs = AppDelegate.UserData.GetFavoriteCodes();
            var root = new CustomRootElement("Favorites")
            {
                from s in MonkeySpace.Core.ConferenceManager.Sessions.Values.ToList()                  //AppDelegate.ConferenceData.Sessions
                where favs.Contains(s.Code)
                group s by s.Start.Ticks into g
                orderby g.Key
                select new Section(HomeViewController.MakeCaption("", new DateTime(g.Key)))
                {
                    from hs in g
                    select(Element) new SessionElement(hs)
                }
            };

            if (favs.Count == 0)
            {
                var section = new Section("Whoops, Star a few sessions first!");

                root.Add(section);
            }
            return(root);
        }