Omer van Kloeten's .NET Zen

Programming is life, the rest is mere details

News

Omer van Kloeten's Facebook profile

Get Firefox

.NET Resources

Articles :: CodeDom

Articles :: nGineer

Culture

Projects

Browse by Tags

All Tags » Advices (RSS)
LINQ Performance Pitfall - Deferred Execution
When using LINQ, queries may bloat up to dozens of lines. My personal style is to take these queries and break them apart to smaller units of logic. To each unit of logic, I append a call to ToArray . @yosit asked me why I did it and I answered I was...
A Limitation of Lambda Expressions and Overloaded Extension Methods
Tamir hates lambdas. He was having a problem with one of his lambda expressions and twittered about it. Around that time I opened my twitter account (yes, Yosi finally convinced me) and offered my help. He wanted to have a single extension method that...
Catching Handled Exceptions During Debugging
Got an exception being thrown with only its name being displayed in the output window? Want to catch that exception? Just click on Debug -> Exceptions (Ctrl D, E) and check the exception you want to catch whenever it's thrown: Now the debugger will...
Linked List Insertion Capable of Surviving Abnormal Termination
I just finished a short conversation with Aaron Randall from London who used the little Windows Live Messenger Flash application in my sidebar (oh, how I love thee, Internets) to ask me a question he had about linked lists after reading one of my posts...
ObservableCollection<T>.CollectionChanged Caveat
DO NOT return null values from collection properties or from methods returning collections. Return an empty collection or an empty array instead. Users of collection properties often assume that the following code will always work: IEnumerable < string...
Windows Forms' GenerateMember
A little known, as far as I can tell from asking around, yet extremely useful property in the Windows Forms designer's property grid is GenerateMember . Defaulting to true , it decides whether a control/component gets declared as a field on the form ...
Finding Out Why Control.Invoke Throws Undocumented Exceptions
A colleague was baffled by having Control.Invoke (when called from a different thread) throw an ArgumentException at him and asked if I knew what was happening. Opening the stack trace, I found that the exception originated from Control.MarshaledInvoke...
Bubbling Windows Forms Events With Anonymous Methods
The following code illustrates a great use for anonymous methods. public class MyContainerControl : Control { private class MySpecializedControl : Control { protected virtual void OnMyEvent(EventArgs e) { if ( this .MyEvent != null ) this .MyEvent( this...
Save User Details For Team Explorer
Since I've started working with CodePlex, Team System failed to even remember my username whenever I started Visual Studio. After digging a bit, I found the answer. Start the Stored User Names and Passwords control panel: rundll32 keymgr.dll,KRShowKeyMgr...
CodeDom Tip: Cache Reusable Objects
Because CodeDom is so verbose and uses a massive grid of objects to represent code structures, it also has many small reusable objects, such as CodeTypeReference objects. Many people overlook this fact because there are so many object being created anyway...
More Posts Next page »