February, 2013
27 02 2013
This is a follow-up of Introducing Extension Methods This method is an extension of the string-class. It reverts a string in a very efficient way and it is widely used around the world. Faster methodes use either unsafe code or only work fast on very short strings. Share :
C#, Extension, Method, NET
27 02 2013
Sometimes you have to work with alot of numbers and want to save them in a file. Especially when you want to save alot of small numbers, it is inefficient to use a whole byte, or worse an int. When i started to write a program to search a specific pattern of moves played in […]
C#, language independent
26 02 2013
At some point in the development of a function or application we ask our self: “Is this the best way to do it”. This is the moment for StopWatch to step forward and help us out. Normaly we would add StopWatch to the method we want to measure and remove the code afterwards. But that’s […]
20 02 2013
Sometimes it is necessary to compile code explicitly at runtime. For example you can create a small user defined shell. Today I will show you how this can be done. At first we need the following: MemoryStream, StreamWriter and namespaces System.Reflection and System.CodeDom.Compiler. This works as follows: Define a source code that will be compiled […]
Assembly, C#, Code, Compile, Runtime, Shell
13 02 2013
It may seem simple to generate a squared control, but it isn’t. At least when the control should work with different screen resolution and window sizes. Thats a must have for any WPF-Control. In the old Windows-Forms days we would have listened to a resize-event on the height or width-property and told the otherone the […]
C#, CustomControl, Game, WPF
6 02 2013
Sometimes we have to know what happens inside other objects like a collection where new entries are added or removed. So we have to make use of a nice feature called Events. In this post I will give you a first insight in Events with a snippet for an observable collection called WatchedList. Observable collections […]
C#, Events
1 02 2013
With Extension methods you can extend the existing funtionality of objects and types. In this case we will extend the functionality of an Array. So we need to create two extensions. One for changing the size and one for appending a new element. What do we need for this? At first we need a static […]
Array, C#, Extension, Method, NET