5 messages in com.googlegroups.google-calendar-help-dataapiRe: ASP.NET "agenda" events to GCalendar
FromSent OnAttachments
ric....@gmail.com25 Oct 2006 05:04 
yonah25 Oct 2006 07:49 
ric....@gmail.com25 Oct 2006 11:12 
Frank Mantek26 Oct 2006 03:51 
ric....@gmail.com26 Oct 2006 09:27 
Subject:Re: ASP.NET "agenda" events to GCalendar
From:Frank Mantek (fman@gmail.com)
Date:10/26/2006 03:51:12 AM
List:com.googlegroups.google-calendar-help-dataapi

why don't you start by looking in the src/unittests or samples directory? In unittests/caltest.cs are examples on how to insert, as are in the calendar sample.

As EventEntry is a subclass of AtomEntry, using service.insert(evententry) should work just fine. What are the problems you are running into?

On 10/25/06, ric.@gmail.com <ric.@gmail.com> wrote:

Yonah,

Thanks for the reply...

I was poking around a bit more and found the When() portion to add my times, but now I've got problems with adding the EventEntry into the AtomEntry.

Here's the code that I'm working with...it's a "mash-up" of a couple of the examples on the code.google.com site.

EventEntry ee = new EventEntry(); AtomPerson author = new AtomPerson(AtomPersonType.Author); author.Name = "Ric Castagna"; author.Email = "ric.@gmail.com"; ee.Authors.Add(author); ee.Title.Text = "Inspection: " + txtAddress.Text.ToString();

string sDateTime = txtDate.Text.ToString() + ddlTime.SelectedValue.ToString(); DateTime startTime = DateTime.Parse(sDateTime); When t = new When(); t.StartTime = startTime; t.EndTime = startTime.AddHours(2); ee.Times.Add(t);

System.Text.StringBuilder sb = new System.Text.StringBuilder(); // Stuff goes here to build the content ae.Content.Content = sb.ToString();

Uri postURI = new Uri(calenderfeeduri);

Service service = new Service("cl", "application_name"); System.Net.NetworkCredential nc = new System.Net.NetworkCredential("username", "password"); service.Credentials = nc;

try { AtomEntry insert = service.Insert(postURI, ae);

} // try catch (Exception ex) { Response.Write(ex.Message.ToString()); } // catch

The thing that's getting me is that the service.Insert() will only accept and AtomEntry object. I don't know how to add the EventEntry to the AtomEntry in order to insert it into the calendar. Or, am I missing the point completely?

I see that the EventEntry actually has more "stuff" than the AtomEntry, but don't see how to submit it into the calendar.

I feel like a blind man in a maze at the moment...