public static IEnumerable <Cronofy.Event> ReadEvents()
        {
            IEnumerable <Cronofy.Event> events = new Cronofy.Event[0];

            var readEvents = new GetEventsRequestBuilder()
                             .IncludeManaged(true)
                             .Build();

            try
            {
                events = CronofyAccountRequest <IEnumerable <Cronofy.Event> >(() => { return(AccountClient.GetEvents(readEvents)); });
                LogHelper.Log("ReadEvents success");
            }
            catch (CronofyException)
            {
                LogHelper.Log("ReadEvents failure");
            }

            return(events);
        }
        public static IEnumerable <Cronofy.Event> ReadEventsForCalendar(string calendarId)
        {
            IEnumerable <Cronofy.Event> events = new Cronofy.Event[0];

            var readEvents = new GetEventsRequestBuilder()
                             .IncludeManaged(true)
                             .CalendarId(calendarId)
                             .Build();

            try
            {
                events = CronofyAccountRequest <IEnumerable <Cronofy.Event> >(() => { return(AccountClient.GetEvents(readEvents)); });
                LogHelper.Log(String.Format("ReadEventsForCalendar success - calendarId=`{0}`", calendarId));
            }
            catch (CronofyException)
            {
                LogHelper.Log(String.Format("ReadEventsForCalendar failure - calendarId=`{0}`", calendarId));
            }

            return(events);
        }
示例#3
0
 /// <summary>
 /// Determines whether the specified <see cref="Cronofy.Event"/> is
 /// equal to the current <see cref="Cronofy.Event"/>.
 /// </summary>
 /// <param name="other">
 /// The <see cref="Cronofy.Event"/> to compare with the current
 /// <see cref="Cronofy.Event"/>.
 /// </param>
 /// <returns>
 /// <c>true</c> if the specified <see cref="Cronofy.Event"/> is equal to
 /// the current <see cref="Cronofy.Event"/>; otherwise, <c>false</c>.
 /// </returns>
 public bool Equals(Event other)
 {
     return other != null
         && this.EventUid == other.EventUid
         && this.EventId == other.EventId
         && this.CalendarId == other.CalendarId
         && this.Created == other.Created
         && this.Updated == other.Updated
         && this.Deleted == other.Deleted
         && this.Summary == other.Summary
         && this.Description == other.Description
         && this.ParticipationStatus == other.ParticipationStatus
         && this.Transparency == other.Transparency
         && this.EventStatus == other.EventStatus
         && this.Recurring == other.Recurring
         && object.Equals(this.Organizer, other.Organizer)
         && object.Equals(this.Location, other.Location)
         && object.Equals(this.Start, other.Start)
         && object.Equals(this.End, other.End)
         && EnumerableUtils.NullTolerantSequenceEqual(this.Attendees, other.Attendees)
         && EnumerableUtils.NullTolerantSequenceEqual(this.Categories, other.Categories);
 }