public async Task Announce() { //First program run and an announce file exists. if (firstRun && File.Exists(announcePath)) { firstRun = false; GetPreviousAnnounceAsync(); } caltick++; if (_dataServices.calUpdateTicks < caltick) { caltick = 0; currentEventInfo = _googleCalendar.GetEvents(); if (AnnounceMessage == null) //No current message. { await PostAnnounce(await FormatPlaytestInformationAsync(currentEventInfo, false)); } else if (currentEventInfo[2] == lastEventInfo[2]) //Title is same. { await UpdateAnnounce(await FormatPlaytestInformationAsync(currentEventInfo, false)); } else //Title is different, scrub and rebuild { await RebuildAnnounce(); } } }
public LevelTesting(DataServices dataServices, Random random) { _dataServices = dataServices; _random = random; _googleCalendar = new GoogleCalendar(_dataServices); currentEventInfo = _googleCalendar.GetEvents(); //Initial get of playtest. lastEventInfo = currentEventInfo; //Make sure array is same size for doing compares later. }
//obtiene todos los eventos de googlecalendar del usuario private void ObtenerEventos() { var events = _calendariogoogle.GetEvents(); _eventos.Clear(); foreach (Event evento in events.Items) { _eventos.Add(evento); if (evento.Start.DateTime.HasValue) { _significantDates.Add(evento.Start.DateTime.Value.Date); } } //DataContext = null; DataContext = this; }