OK, I started out just trying to implement for the Smart Device application what I had in the sample Windows Forms calendar application ... but I got carried away a bit as you can see when you download the sample calendar application for the smart device.
First, and perhaps most important, how to get the bolded dates. There is no AddBoldedDates method for the MonthCalendar control in the .NET Compact Framework. The answer is the BoldedDates property that is available. An array of dates can be assigned to this property. So the trick is to first create an array of dates (i.e., Dim myDates As Date() ), fill this array with the relevant dates, and then assign the array to the BoldedDates property (i.e., MonthCalendar1.BoldedDates = myDates ) ... that's it!
I like to use the ArrayList as a flexible array container whenever I do not know the number of items that need to go into an array. So I fill the array list with my dates ( al.Add(thisDate ) and then turn the array list into an array of dates ( al.ToArray(GetType(Date)) ).
Then I thought, it would be nice if I could already see the calendar and work with the UI while my Web service is busy getting the calendar information from Google. So I went ahead and implemented an asynchronous Web service call. Rather than calling the getGoogleCalendar method I use the asynchronous BegingetGoogleCalendar method. This method does not return the calendar, instead it just kicks off the Web service. I now need an event handler that is executed when the Web service returns something. In the .NET Framework this is very convenient ... not so in the .NET Compact Framework.
On top of that I thought it might be nice to have progress bar show move along while the Web service is working. Again this involves a bit more work in the .NET Compact Framework. I need a timer and a timer tick event handler in which I update the progress bar.
And then I also needed to wrap the updating of the calendar and the stopping of the progress bar into an event handler and invoke the event handler ... but now it works!!!
There is no expectation that you use asynchronous Web service calls, but you at least know now how to get the bolded dates.
MH
BTW, the sample calendar application for the smart device is zipped up in the code folder on the g-drive.
Technorati : "asynchronous Web service calls", BUS ADM 740, UWM
Powered by Zoundry