I have made the folowing function to insert an appointment into my
GCalendar:
public void insertAppointment(string title, string content, DateTime
start, DateTime end, GCalendarAttendeeCol whocol,AtomPerson author)
{
EventEntry entry = new EventEntry();
When w = new When();
w.StartTime = start;
w.EndTime = end;
AtomPersonConverter tmp = new AtomPersonConverter();
entry.Authors.Add(author);
entry.Title.Text = title;
entry.Content.Content = content;
entry.Times.Add(w);
foreach (Who who in whocol.getAttendees())
{
entry.Participants.Add(who);
}
myResultsFeed.Insert(entry);
}
And made the following class to insert Attendees easier:
public class GCalendarAttendeeCol
{
private Who[] who_array = new Who[0];
public void addAttendee(string name, string email, string
status, string type)
{
Who[] tmp_who_array = new Who[who_array.Length + 1];
for (int i = 0; i < who_array.Length; i++)
{
tmp_who_array[i] = who_array[i];
}
tmp_who_array[who_array.Length] = new Who();
tmp_who_array[who_array.Length].Rel =
Who.RelType.EVENT_ATTENDEE;
tmp_who_array[who_array.Length].Email = email;
tmp_who_array[who_array.Length].Attendee_Status = new
Who.AttendeeStatus();
tmp_who_array[who_array.Length].Attendee_Status.Value =
status;
tmp_who_array[who_array.Length].Attendee_Type = new
Who.AttendeeType();
tmp_who_array[who_array.Length].Attendee_Type.Value =
type;
who_array = tmp_who_array;
}
public Who[] getAttendees()
{
return who_array;
}
}
I now call the the code stated above in the following way:
GCalendarAttendeeCol whocol = new GCalendarAttendeeCol();
whocol.addAttendee("M** de B**", "[EMAIL PROTECTED]",
Who.AttendeeStatus.EVENT_ACCEPTED, Who.AttendeeType.EVENT_REQUIRED);
gcal.insertAppointment("Dit is een test","Dit is om te
testen hoe een insert werkt",new DateTime(2007,09,18,12,00,00),new
DateTime(2007,09,18,13,00,00),whocol,new
AtomPerson(AtomPersonType.Author,"L* Pri*"));
Notice that i use to EVENT_ACCEPTED status. But it seems to set it in
EVENT_INVITED rather, than in EVENT_ACCEPTED and it's sending an
Notification of the invitation.
I'm i doing something wrong or is this just a security feature
preventing my to approve an event from an attendee without their
knowledge?
--~--~---------~--~----~------------~-------~--~----~
You received this message because you are subscribed to the Google Groups
"Google Calendar Data API" group.
To post to this group, send email to
[email protected]
To unsubscribe from this group, send email to [EMAIL PROTECTED]
For more options, visit this group at
http://groups.google.com/group/google-calendar-help-dataapi?hl=en
-~----------~----~----~----~------~----~------~--~---