Adam K Dean

Posts tagged with csharp

Simple Dependency Injection with StructureMap

Published 1 August 2013 in archive with tags csharp , ioc , dependencyinjection Usually when I think of IoC/Dependency Injection for .NET, I think of Ninject, but today I've been looking at an alternative: StructureMap. It claims to be the 'oldest IoC/DI tool for .NET development', in development since 2004, and is available via NuGet including additional versions for both MVC3 and MVC4. Continue reading …

Cross thread calls made easier

Published 27 June 2013 in archive with tags csharp , delegates , generics , threading Back in 2010 I wrote a blog post about cross thread calls, showing how to overcome invalid cross-thread operations and change windows forms from other threads. It was simple but a little bit messy. Continue reading …

Circle primitive class for XNA/MonoGame

Published 24 March 2013 in archive with tags csharp , xna , monogame , gamedev I've just been playing a little with XNA (or MonoGame as it's called these days) and needed to draw circles. If you've used XNA then you'll know that nothing like that is provided for you. Drawing circles isn't too difficult really, they're basically just lots of little lines at different angles. Continue reading …

Using caller information for verbose logging

Published 21 March 2013 in archive with tags csharp , compilerservices , diagnostics A cool feature that has been added in Visual Studio 2012 and C# 5.0 is Caller Information attributes. Basically it allows you to see where your method was called from without having to sift through stack traces upon stack traces. Continue reading …

Save nanoseconds with a quicker Enum.HasFlag

Published 11 March 2013 in archive with tags csharp , bitwise , enum , performance One of the easiest ways to manage security flags is to have an Enum and use bitwise comparisons, however you would expect .NET to make things a bit easier for you, afterall who wants to start littering the code with bitwise expressions? Continue reading …



Newer Page 1 of 4 Older