Welcome to Windows Presentation Foundation (WPF)
Top Tasks :

WPF Community Bloggers

Generic Extension Methods

I've discovered that if an extension method is generic and the generic type is used as the "this" parameter, you do not have to write out the generic discriminator. The compiler is smart enough to infer it for you. For example, the range validation function I shared a few weeks ago can be called like so: int myInt=5; myInt.ValidateRange(2,20); Jeff would be happy. Read More...
Published Sunday, July 20, 2008 8:35 AM by Brownie Points
Filed under:

Comments

No Comments
Anonymous comments are disabled

Copyright © 2006 Microsoft Corporation. All Rights Reserved. | Terms of Use | Privacy Statement | Contact Us