0
Google 캘린더에 기본 일정 키를 입력 한 다음 EventQuery를 호출 한 다음 검색하여 이벤트를 업데이트하려고합니다.asp 응용 프로그램에서 Google 캘린더 일정을 업데이트하는 방법은 무엇입니까?
Evententry 클래스에서 기본 키를 할당하고 나중에 업데이트를 검색 할 속성을 찾지 못했습니다. 행사.
Google 캘린더에 기본 일정 키를 입력 한 다음 EventQuery를 호출 한 다음 검색하여 이벤트를 업데이트하려고합니다.asp 응용 프로그램에서 Google 캘린더 일정을 업데이트하는 방법은 무엇입니까?
Evententry 클래스에서 기본 키를 할당하고 나중에 업데이트를 검색 할 속성을 찾지 못했습니다. 행사.
그것은
1.Assign an ID (same as you set in your DB) to each event you add through
ExtendedProperty .
2.When updating/deleting you pass the ID and use Query to fetch it for you
3.If the event is found you can delete/update the specific event
Google.GData.Calendar.EventEntry Entry = new Google.GData.Calendar.EventEntry();
//create the ExtendedProperty and add the EventID in the new event object,
//so it can be deleted/updated later
ExtendedProperty oExtendedProperty = new ExtendedProperty();
oExtendedProperty.Name = "EventID";
oExtendedProperty.Value = GoogleAppointmentObj.EventID;
Entry.ExtensionElements.Add(oExtendedProperty);
string ThisFeedUri = "http://www.google.com/calendar/feeds/" + CalendarID
+ "/private/full";
Uri postUri = new Uri(ThisFeedUri);
//create an event query object and attach the EventID to it in Extraparameters
EventQuery Query = new EventQuery(ThisFeedUri);
Query.ExtraParameters = "extq=[EventID:" + GoogleAppointmentObj.EventID + "]";
Query.Uri = postUri;
//Find the event with the specific ID
EventFeed calFeed = CalService.Query(Query);
//if search contains result then delete
if (calFeed != null && calFeed.Entries.Count > 0)
{
foreach (EventEntry SearchedEntry in calFeed.Entries)
{
SearchedEntry.Delete();
//To update comment the code above and uncomment the code below
//CalService.Update(SearchedEntry);
break;
}
}
else
{
InsertedEntry = CalService.Insert(postUri, Entry);
}
아래의 방법을 사용 ExtendedProperty를 사용하여 수행 할 수 있습니다