Archives for: February 2007
24/02/07
BASTA next week
21/02/07
Sony Reader power consumption
I got myself a Sony Reader (Portable Reader System PRS-500 – is that a better name?) a few weeks ago. Great little device, and I’ve been reading a lot on it since I got it. In the beginning I also regularly had it hooked up to the computer to upload content, but now I’ve got nearly 50 books in it that need reading, so I didn’t hook it up for a while.
Since the device didn’t have any power supply connected, I’m checking out how long the battery actually works. Sony says it should be around 7500 page turns, and it seems to me that this is rather far from the truth… the power meter in the device is a bit jumpy – it has 4 parts, and every time it goes down one, it spends some time flipping back and forth. I got down from 3/4 to 2/4 one day, and the next day I was up to 3/4 again, stayed there for quite some time before going back down. Right now I’m on the brink of going down to 1/4, and while I haven’t counted the pages I’ve read meticulously, I’m guessing that I should be at about 3000 page turns now. Reaching 7500 before the battery needs recharging seems rather unlikely.
Do you have any experiences with this? Mind you, I’m not saying I have a problem with the battery. I’m sure it lasts long enough for anyone the way it is. I’m just wondering whether other people’s experience is similar to what I’m seeing.
Vista Sidebar? Do we love it or not?
I talked about this to Ian the other day: is the Vista Sidebar system really good or not? Of course there’s no simple answer to this, but I had some thoughts and they’re not all positive.
First, let me say that I really like the whole gadget idea. Somehow I was always a fan of that kind of thing – Linux was always strong in this regard, and I used to do a lot of work on Linux. The original announcement about the Vista Sidebar had me rather enthusiastic about it, and the great looks it promised to have were also appreciated. I do use the Sidebar today, and as far as it goes, I really like it.
So what’s the problem? Several things about the implementation:
- The Sidebar is just too damn small for many useful ideas. Simple thing. My laptop screen is 1050 pixels high, and the Sidebar takes up half of that space with four gadgets that actually reproduce standard system tray functionality in a nicer way – clock, calendar, CPU meter and battery monitor. Doesn’t leave a lot of space for all those new gadgets….
- Sure, the Sidebar has multiple pages. Well, that totally defeats the purpose for me… I don’t want to go hunt for those tiny buttons (top right, in case you’ve never noticed) to switch to another page. They could have done this much better – implement a “drawer” type gadget, for instance, that would extend out horizontally.
- There’s not even a way, as far as I know, for a gadget running on the second (or any other than the first) page of the Sidebar to say “hey, I’ve got something interesting here that I need the user to know about”. So unless you actively go and switch to the other pages, gadgets running on these are memory hogs, nothing more.
- You can undock gadgets, which is nice – also visually. But, have you ever tried finding an undocked gadget on your desktop? They get lost behind other windows, and they don’t come back to the foreground when you activate the Sidebar itself. They also don’t have buttons on the taskbar and they don’t appear when switching tasks using Alt/Win-Tab. So the only way to ever get an undocked gadget back is to close windows until you see it. Well.
- The Sidebar can only dock left and right. Not a problem on my laptop, but on my desktop system (which doesn’t run Vista so far) I have three monitors, two of which are vertical. So I’d want to dock the Sidebar on the top or bottom edge, right? Well, no way. This is actually something that I reported back when Sidebar was first announced, but I never got a reply on the issue.
In the end I still like the Sidebar for what it does. It’s just a real pity it doesn’t go a whole lot further… it would have been great to have a good platform for a unified plugin architecture, but I guess it won’t be long until 3rd party vendors will start creating their own again due to the problems in the standard Sidebar. And there goes – with some probability – the standard plugin architecture…
20/02/07
Slides and samples for my Extensible Linqing session
I was at NxtGenUG in Birmingham yesterday, doing a session about LINQ extensibility. I thought it was good, but ask the attendees if you want to be sure :-) In any case I promised to make my samples and slides available, so here they are: Extensible LINQing.zip (145 K![]()
17/02/07
Wrapping collections with ITypedList - part 2, the download
In part 1 of this post, I have explained what the purpose of those wrapper classes is that I have created, and why the structure is how it is. I’m making the source code of the library available with this post – use it as you see fit, but please note that I have done no production testing of this code, so don’t blame me if it breaks.
The download is here: Sturm.CollectionWrapping.zip (6 K![]()
Now how do you use that thing? Basically you use code like this:
BindingList<string> list = new BindingList<string>( ); BindingList<string> wrappedList = TypedListWrapper.CreateWrapper(list, propertyDescriptorCollection);
Now, depending on the type of list you wrap, the return value of the CreateWrapper method is actually of one of the following four types:
- TypedListWrapperBindingListT – this is used for BindingList<T> derived collections
- TypedListWrapperIBindingList – this is used for collections that implement IBindingList, but are not derived from BindingList<T>
- TypedListWrapperIListT – this is used for collections that implement IList<T>
- TypedListWrapperIList – for collections that implement IList
The selection is made in one of two ways. The first approach is based on method overloads that exist for the CreateWrapper method. So as long as the compiler can find out what type you’re using, you’ll get the correct wrapper type that way. The second approach uses an overload of the CreateWrapper method that uses “object” as the type of the collection. In this case, an algorithm runs that uses Reflection to find out in which category (of the above list) the given collection fits. This second approach seemed necessary as there are many situations when coding in .NET, where a collection type is obtained from some source that is not clearly typed (like a control’s DataSource property, to name one simple example).
Finally, the parameter “propertyDescriptorCollection” is of course just that – the collection of property descriptors that is returned by the ITypedList method GetItemProperties. There is a property called “PropertyDescriptorCollection” on the wrapped collection type, so you can change the collection after the fact. Most of the methods and constructors also have other overloads – read the source to find out more about them.
So, have fun with the library, I hope it’s useful. Let me know if you find any problems, if you have questions or suggestions for extensions.


