示例#1
0
        async public Task <List <CalendarEvent> > getCalendarEvents(TimeLine calculationTimeLine, bool retrieveGoogleLocation, uint calIndex = 0)
        {
            //var PrepList = CalendarServiceInfo.Events.List(EmailID);

            List <CalendarEvent> RetValue = new List <CalendarEvent>();
            var list = getAllGoogleEvents(calculationTimeLine);

            if (list.Count > 0)
            {
                EventID googleAuthenticationID = EventID.generateGoogleAuthenticationID(calIndex.ToString());
                RetValue = (await GoogleCalExtension.getAllCalEvents(list, CalendarServiceInfo, EmailID, googleAuthenticationID, calculationTimeLine, retrieveGoogleLocation, AuthenticationInfo.DefaultLocation).ConfigureAwait(false)).ToList();
            }
            return(RetValue);
        }
示例#2
0
        async public Task <List <CalendarEvent> > getCalendarEventsForIndex(TimeLine CalculationTimeLine, bool retrieveGoogleLocation)
        {
            IList <Event>        list     = getAllGoogleEvents(CalculationTimeLine);
            List <CalendarEvent> RetValue = new List <CalendarEvent>();

            if (list.Count < 1)
            {
                return(RetValue);
            }

            EventID googleAuthenticationID = EventID.generateGoogleAuthenticationID(((TilerFront.Models.IndexedThirdPartyAuthentication)AuthenticationInfo).ThirdPartyIndex.ToString());

            RetValue = (await GoogleCalExtension.getAllCalEvents(list, CalendarServiceInfo, EmailID, googleAuthenticationID, CalculationTimeLine, retrieveGoogleLocation, AuthenticationInfo.DefaultLocation).ConfigureAwait(false)).ToList();

            return(RetValue);
        }
示例#3
0
        /// <summary>
        /// Function generates google calendar control. Its populated with events retrieved within +/- 90 days of google calendar update. It returns null if access to google api is lost.
        /// </summary>
        /// <returns></returns>
        async public Task <GoogleThirdPartyControl> getThirdPartyControlForIndex()
        {
            GoogleThirdPartyControl RetValue = null;
            DateTimeOffset          now      = DateTimeOffset.UtcNow.removeSecondsAndMilliseconds();
            TimeLine      timeline           = new TimeLine(now.AddDays(Utility.defaultBeginDay), now.AddDays(Utility.defaultEndDay));
            IList <Event> list = getAllGoogleEvents(timeline);

            if (list.Count < 1)
            {
                return(RetValue);
            }
            EventID googleAuthenticationID = EventID.generateGoogleAuthenticationID(((TilerFront.Models.IndexedThirdPartyAuthentication)AuthenticationInfo).ThirdPartyIndex.ToString());

            List <CalendarEvent> RetValueList = (await GoogleCalExtension.getAllCalEvents(list, CalendarServiceInfo, EmailID, googleAuthenticationID, null, false, AuthenticationInfo.DefaultLocation).ConfigureAwait(false)).ToList();

            RetValue = new GoogleThirdPartyControl(RetValueList);
            return(RetValue);
        }