Author Archives:

JavaScript commas in IE

While working with JQuery UI DataTables I got some strange JS errors in IE. And not from any-better-browser. ‘style’ is null or not an object My Google cortex provided the answer: IE javascript engine treats array/object initialization different from other engines. While other browsers simply ignores if the initialization has a trailing comma, IE don’t. [...]

Getting the name attribute of an MVC Html-helper output

It seems odd there is no standard way of getting the name of a control rendered with the Html helper extensions in MVC3 Razor. I saw some proposed solutions, but none of the actually worked e.g. in partial views or list binding. This solution gets it right, but is nonetheless just another hack. You can [...]

ProcessItems UX pattern

Here’s a general implementation for the common UX scenario where a items in a list should be processed, and that processing might fail, so reprocessing might be needed for those items. This used e.g. when copying a bunch of files or collecting data from loosely connected distributed systems. /// <summary> /// General UX process pattern [...]

Generic Iterator

I just generalized the iterator implemented in my previous blog post to non-recursively iterate any object tree. static IEnumerable<T> Iterate<T>(T rootNode, Func<T, IEnumerable<T>> getChildren) { var stack = new Stack<T>(); stack.Push(rootNode); while (stack.Count > 0) { T node = stack.Pop(); yield return node; IEnumerable<T> childNodes = getChildren(node); foreach (var childNode in childNodes) stack.Push(childNode); } }

Custom DropDown Control

Extensibility is not the strongest feature of Windows Forms. I recently required a custom drop down control like the common color picker or date picker control. I started out with http://www.logresource.com/Question/1080206/showall/ and modified it to properly handle usercontrols and keyboard control. // based on http://www.logresource.com/Question/1080206/showall/ internal class PopupComboBox : ComboBox, IMessageFilter { // http://www.woodmann.com/fravia/sources/WINUSER.H const [...]

Follow

Get every new post delivered to your Inbox.