September, 2013
30 09 2013
Sometimes, especially with C# you hear alot of “common knowledge” about performance and developers mistakes. As an (bad) example I want to refer to 8 Most common mistakes C# developers make and in particular point 7 “using foreach instead of for”. So whats wrong with this kind of post? First of all, it refers to […]
25 09 2013
Today we introduce a new category on AllInSight.de: Difference between a duck. We took that line from the movie Postal. And the category is about things that are the same or look alike and also about things other think are the same but actually they are different. For a start I’ll show that for and […]
16 09 2013
As I mentioned in the last post, you can’t use SlidingExpiration and AbsoluteExpiration a the same time. Thats by design. Thanks again, Microsoft. But there is a workaround. First i will present the solution and then a short and easy way to use it. The ObjectCache / MemoryCache has a nice little function called CreateCacheEntryChangeMonitor. […]
Expiration, extended method, memotycache, ObjectCache
11 09 2013
A while ago i wrote a post about the ObjectCache / MemoryCache and here is a little follow up. The ObjectCache allow you to set an expiration on an object you put into it. Thats very useful since most objects are only valid for a short time. When you want to cache a result from […]
Expiration, MemoryCache, ObjectCache
9 09 2013
The Windows Communication Foundation (WCF) is one of the best things Microsoft ever did for us. Whoever tried to build a Webservice, especially with REST and SOAP and then worked with WCF know what i mean. But today i just want to show you, how a WCF-Service can be used without an IIS and event […]
NamedPipes, REST, SOAP, standalone, WCF
7 09 2013
In Java the final-keyword on a parameter indicates that it is not changeable and in C/C++ you could use const. But in C#, there is no way (thanks Microsoft, well done ;-)) In Java and especially with the CleanCode-Paradigma the final keyword is used wherever possible to indicate that you use this variable only as […]
final, ReadOnlyCollection
4 09 2013
Its not in the genes its the environment! They are not evil just misunderstood. Yeah, ok you get it 😀 Singletons are a very special type of objects and should be treated like that. There is no general pattern to implement and no keyword to identify them. So what the heck is a singleton? A […]
4 09 2013
Today i want to show you how to use enumerations to set multiple values in a variable using bit-flags. Normaly enums are an easy way to set a single value and check later which value is set working with a static name throughout your entire application. Enums are much better then magic numbers or constants […]
Bit-Flags, boolean array, enum, FlagsAttribute bit operations
2 09 2013
Sometimes its necessary to change the mousecursor of an application to show the user that something goes on. Most times we just want to show the wainting-cursor as long as an operation takes and switch then back. The first problem you’ll encouter, is exception-handling. You need to put everything into a try-finally-block to get your […]
cursor, IDisposible, OverrideCursor, singleton, using
2 09 2013
It is very helpful to know if and what exceptions a method can throw. Unfortunately there is no throws-keyword like in Java. But there is an easy way to document what exceptions can be thrown and show this information in intellisens. You can use the xml-documentation of a method to document which exceptions are thrown […]
document, exception intellisens, throw, throws