Ejemplo n.º 1
0
 private void updateCalendar(CalStore calStore)
 {
     // move some of the events around and update the sequences
     foreach (var ev in calStore.Calendar.Events)
     {
         double nextNum = rnd.NextDouble();
         if (nextNum > 0.6d)
         {
             // update the sequence because we're changing this event
             ev.Sequence = calStore.TimesCalled;
             ev.dtStart.AddHours(1);
             ev.dtEnd.AddHours(1);
         }
     }
 }
Ejemplo n.º 2
0
        public async Task <VCalendar> GetCalendar(string userId)
        {
            if (!userCals.ContainsKey(userId))
            {
                userCals[userId] = new CalStore()
                {
                    TimesCalled = 1, Calendar = BuildCalendar(userId)
                };
            }
            else
            {
                userCals[userId].TimesCalled++;
                updateCalendar(userCals[userId]);
            }

            return(userCals[userId].Calendar);
        }