Ejemplo n.º 1
0
        // Appends a section to the list.
        public bool AppendSection(RootElement root, IEnumerable <MonkeySpace.Core.Session> list, string title)
        {
            if (list == null || list.Count() == 0)
            {
                return(false);
            }

            var sschedule = new Section();
            var schedule  = new CustomRootElement("Sessions")
            {
                sschedule
            };

            foreach (var s in list)
            {
                sschedule.Add(new SessionElement(s));
            }

            var section = new Section(title);

            section.Add(schedule);

            AppendFavorites(section, list);

            root.Add(section);

            return(true);
        }
Ejemplo n.º 2
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.º 3
0
        RootElement GenerateRoot()
        {
            // The full list
            var allSessions = new RootElement("All Sessions")
            {
                from s in MonkeySpace.Core.ConferenceManager.Sessions.Values.ToList()                  //AppDelegate.ConferenceData.Sessions
                orderby s.Start ascending
                group s by s.Start.Ticks into g
                select new Section(HomeViewController.MakeCaption("", new DateTime(g.Key), true))
                {
                    from hs in g
                    select(Element) new SessionElement(hs)
                }
            };

            var root = new CustomRootElement("Sessions")
            {
                allSessions
            };

            return(root);
        }
Ejemplo n.º 4
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);
        }