¡@

Home 

c# Programming Glossary: dofoo

method overloading vs optional parameter in C# 4.0 [duplicate]

http://stackoverflow.com/questions/3316402/method-overloading-vs-optional-parameter-in-c-sharp-4-0

the solution like this Base foo method public void DoFoo int a long b string c Do something Foo with 2 params only public.. b string c Do something Foo with 2 params only public void DoFoo int a long b .... DoFoo a b Hello public void DoFoo int a ...... Foo with 2 params only public void DoFoo int a long b .... DoFoo a b Hello public void DoFoo int a .... DoFoo a 23 Hello .......

Catch an exception thrown by an async method

http://stackoverflow.com/questions/5383310/catch-an-exception-thrown-by-an-async-method

invalid... a ProtocolException might be thrown public void DoFoo try Foo catch ProtocolException ex The exception will never.. only do so if you await the call to Foo public async void DoFoo try await Foo catch ProtocolException ex The exception will..

What is quicker, switch on string or elseif on type?

http://stackoverflow.com/questions/94305/what-is-quicker-switch-on-string-or-elseif-on-type

the same as an if else chain. switch someString case Foo DoFoo break case Bar DoBar break default DoOther break is the same.. default DoOther break is the same as if someString Foo DoFoo else if someString Bar DoBar else DoOther Once the list of items.. someString out switchIndex switch switchIndex case 0 DoFoo break case 1 DoBar break else DoOther In some quick tests that..