/// <summary> /// Drops an existing database, creates a new one, fetches all ics elements from server, /// writes their etags, uids and urls to the database, converts the ics to Outlook Appointments /// and returns them. /// </summary> /// <returns>A collection of all appointments on serverside.</returns> public AppointmentSyncCollection GetInitialSync() { _localStorage.RebuildDatabase(); AppointmentSyncCollection responseList = new AppointmentSyncCollection(); List <CalDavElement> responseListCalDav = GetAllItemsFromServer(); responseListCalDav.ForEach(delegate(CalDavElement element) { _localStorage.WriteEntry(element.Guid, element.ETag, element.Url); responseList.AddList.Add(CalDavElementToAppointmentItemConverter.Convert(element)); }); return(responseList); }