« Is it truly open? | Main | Accessing DataRow after it has been deleted »

June 05, 2005

System.Type.Missing

If you do a lot of COM interop with .NET, no doubt you'll find lots of methods with parameter that you don't really care. Have you ever come across this situation? Where you ended up reading opening up the doc and trying to set the default value one by one? It's annoying and cumbersome as hell, thank god .NET has System.Type.Missing that will automatically sets the default value for the parameters.

From the doco:

Use the Missing field for invocation through reflection to obtain the default value of a parameter. If the Missing field is passed in for a parameter value and there is no default value for that parameter, an ArgumentException is thrown.

Posted by vhadiant at June 5, 2005 05:58 PM





Trackback Pings

TrackBack URL for this entry:
http://www.hadianto.net/mov32/mt-tb.cgi/54

Comments

Post a comment





Remember Me?

(you may use HTML tags for style)