All entries for March 2006
March 31, 2006
Writing about web page http://www.gotdotnet.com/workspaces/workspace.aspx?id=ccbb6b50-6c55-4291-b191-f5c5f80ba122
I've been doing more work on the BindingListView
A problem I faced was when displaying a master-details style UI. I could make the master list a BindingListView (with filtering, sorting, etc) but then the child "details" list would just be whatever the business object had defined it as e.g. List
While the business object developer could add an additional property that exposed a BindingListView of a list, that violates the separation of business logic and UI logic. (Since a view is really only for the UI's benefit.)
The solution was to make the view object provide additional properties at runtime using its ITypedList interface implementation. Basically, it looks for properties that implement generic IList and then returns additional properties for a BindingListView of those. The actual view objects are stored in the EditableObject
So I can now set the DataMember of a child bindingsource on my form to something like "OrderView". This is the provided view of the "Orders" list.
March 17, 2006
This evening I wrote an OMPL generator for my managed Feed API wrapper. It makes use of the Visitor design pattern – so all the OPML stuff is totally separate from the feed classes.
This allows a user to export their Windows RSS subcriptions to OPML for use in other application/websites.
I'm going to make an OPML importer as well, to ease migration to Windows Feeds.
March 16, 2006
That above is using C#3.0 with LINQ to search for all items from all feeds that were published after yesterday. The results are also sorted by title.
FeedFolder folder = FeedFolder.GetRoot();
DateTime yesterday = DateTime.Now.Subtract(TimeSpan.FromDays(1));
var allItems = folder.AllFeeds.SelectMany
(f => f.Items);
var items =
from item in allItems
where item.PubDate > yesterday
foreach (var item in items)
Note how none of that required adding sort or filter code to the object model! LINQ is totally awesome!
I have been working on the managed wrapper for the Windows RSS API. The adapter layer is able to pull all the folders, feeds and items across into my object model. This can then be traversed using standard .NET foreach constructs, or even LINQ!
The wrapper is two-way, in that changes made to certain properties are pushed back to the Windows RSS store. I can even add new feeds and folders.
I am also working on the eventing system to receive notifications when the RSS store changes. These events will be pushed up through my model so .NET applications can respond. I'm still working the kinks out of the COM event handlers. I'm not sure if I'm hitting beta bugs, or if my code is wrong…
Here's a little taster of the wrapper in action:
FeedFolder root = FeedFolder.GetRoot();
root.FeedAdded += delegate(object sender, FeedAddedEventArgs e)
Console.WriteLine("Feed added: " + e.NewFeed.Url.ToString());
foreach (Feed feed in root.AllFeeds)
foreach (Item item in feed.Items)
Console.WriteLine(" " + item.Title);
FeedFolder folder = root.AddSubFolder("Hello World");
folder.AddFeed("Me", new Uri("http://blogs.warwick.ac.uk/andrewdavey/?rss=rss_2_0"));
March 13, 2006
Writing about web page http://blogs.msdn.com/rssteam/
(Ahem.. long time, no post… I'm back now. Woooo!)
I was very happy to hear that IE7 will have an API for its common feed list. This will allow developers to use a single common store for any RSS the user is subscribing to. The only downside is that the API is exposed via COM. That's right, freakin' 1990s COM…!
Whilst it is totally possible to interop with COM from .NET, the code looks ugly in places. (Lots of casts from "object", etc). With no sign of a decent managed wrapper out there, I have decided to create my own.
My wrapper will expose a .NET friendly, data bindable components, to enable drag-n-drop development of RSS applications. I'm also making the wrapper entirely plugable with respect to the back end store. This means it could work with something else besides the IE7 Common Feeds List. For example, someone running on Linux with Mono won't have IE7, so there could be a different feed manager.
I've only just begun, but if people are interested please leave comments. I may make this an open source project, if there is positive feedback.