¡@

Home 

c# Programming Glossary: cases

Using IoC for Unit Testing

http://stackoverflow.com/questions/1465849/using-ioc-for-unit-testing

Mock IMyDependency .Object var sut new MyClass dep In some cases an auto mocking container can be nice to have but you don't..

Creating a byte array from a stream

http://stackoverflow.com/questions/221925/creating-a-byte-array-from-a-stream

you just don't know how much data there will be. In such cases I'd use code like this public static byte ReadFully Stream input..

What is a good pattern for using a Global Mutex in C#?

http://stackoverflow.com/questions/229565/what-is-a-good-pattern-for-using-a-global-mutex-in-c

not hang forever if the mutex is not acquired Deals with cases where other processes abandon the mutex c# concurrency mutex..

When to Use Static Classes in C#

http://stackoverflow.com/questions/241339/when-to-use-static-classes-in-c-sharp

classes that do not pose any risk to bloat are excellent cases for static methods System.Convert as an example. If your project..

Returning IEnumerable<T> vs IQueryable<T>

http://stackoverflow.com/questions/2876616/returning-ienumerablet-vs-iqueryablet

difference and working on IQueryable T can in many cases save you from returning too many rows from the database. Another..

Is there a better alternative than this to 'switch on type'?

http://stackoverflow.com/questions/298976/is-there-a-better-alternative-than-this-to-switch-on-type

set public static void Do object source params CaseInfo cases var type source.GetType foreach var entry in cases if entry.IsDefault.. cases var type source.GetType foreach var entry in cases if entry.IsDefault entry.Target.IsAssignableFrom type entry.Action..

What is the difference between i++ and ++i?

http://stackoverflow.com/questions/3346450/what-is-the-difference-between-i-and-i

They are Pre increment post increment operators. In both cases the variable is incremented but if you were to take the value..

Performance differences between debug and release builds

http://stackoverflow.com/questions/4043821/performance-differences-between-debug-and-release-builds

This can occur due to constant folding and inlining. Other cases is where the JIT compiler can determine that the code has no..

Best practices for exception management in Java or C#

http://stackoverflow.com/questions/409563/best-practices-for-exception-management-in-java-or-c-sharp

catching exceptions is not the right thing to do in most cases. There are a few exceptions e.g. logging and marshalling exceptions.. marshalling exceptions between threads but even for those cases you should generally rethrow the exceptions. You should definitely..

Casting vs using the 'as' keyword in the CLR

http://stackoverflow.com/questions/496096/casting-vs-using-the-as-keyword-in-the-clr

is a reference type or a value type. There may be other cases involving generics where is is useful because you may not know..

Developing Internet Explorer Extensions?

http://stackoverflow.com/questions/5643819/developing-internet-explorer-extensions

Mode where BHOs are not allowed to run except in edge cases. see http blogs.msdn.com b ieinternals archive 2012 03 23 understanding.. Mode where BHOs are not allowed to run except in edge cases. see http blogs.msdn.com b ieinternals archive 2012 03 23 understanding..

C# DLL config file

http://stackoverflow.com/questions/594298/c-sharp-dll-config-file

the assembly which your code is actually in. In most cases this will be the assembly of your main .EXE which is what loaded..

What is differences between Multidimensional array and Array of Arrays in C#?

http://stackoverflow.com/questions/597720/what-is-differences-between-multidimensional-array-and-array-of-arrays-in-c

such operations as row swap and row resize. Maybe in some cases usage of multidimensional arrays will be more safe but even..

Using C# regular expressions to remove HTML tags [duplicate]

http://stackoverflow.com/questions/787932/using-c-sharp-regular-expressions-to-remove-html-tags

htmlDocument @ ^ String.Empty This will work for most cases but there will be cases for example CDATA containing angle brackets.. This will work for most cases but there will be cases for example CDATA containing angle brackets where this will..

Why is Multiple Inheritance not allowed in Java or C#?

http://stackoverflow.com/questions/995255/why-is-multiple-inheritance-not-allowed-in-java-or-c

MI is truly appropriate is actually quite small. In many cases multiple interface inheritance can get the job done instead... inheritance can get the job done instead. In other cases you may be able to use encapsulation and delegation. If we were..