Adding methods to enums

I used to often find myself creating utility classes to process enums to create markup or carry out particular actions based on the enum value. Since extension methods have been introduced I have started using them to add processing methods…Continue Reading →

Jquery Show/Hide on mouse

This is a simple function that hides an item when the mouse leaves. The object can be visible initially and will only dissapear once the mouse has entered AND left. $(‘div.mouse.LeaveHide’).on({ mouseover:function(e){ $({ mouseleave:function(e){ $(; } }); } }); jQuery like Closest()

Here is a very simple .Closest() function like the jquery one. public static class ControlExtensions { public static Control Closest(this Control control, Type type ){ Control closest = null; Control parent = control.Parent; while(closest == null && parent != null){ if(parent.GetType().ToString() == type.ToString()){ return parent; } parent = parent.Parent; } return null; } }