Home
  Latest posts
  My Writings
  My Code
  My Gallery
  About me
 
  rssfeed Syndication
 
Bloggtoppen.se
 
 
Links
  Cornerstone
  SweNug
 
Post categories
  misc (48)
  Architecture (21)
  C# (19)
  Asp.Net (2)
  Vb.Net (2)
  Training (7)
  Data (19)
  Events (40)
  Platform (2)
  Orcas (4)
  Updates (3)
  Methods (10)
  Tools (6)
  Announcements (14)
  Languages (1)
  Patterns (6)
  Opinions (11)
  Fun (3)
  Ineta (1)
  Opinion (0)
  Practices (2)
  WCF (5)
 
 
 
Code
Singelton 2.0 Wednesday, February 20, 2008
Singelton has been around for ages, it's about time someone remodernized the pattern. Utilizing generics, implict casts, template method and some reflection I managed to create a reusable Singelton class that allows for usage like:

MyFactory factory1 = new StaticSingelton("Init data");
MyFactory factory2 = new StaticSingelton("Init data");

Which makes sure that factory1 and factory2 shares the same instances of MyFactory. Download the code to see how.
 
Linq To Sql entity extensions Friday, February 08, 2008
This class contains extension methods to get the DataContext from a single Linq To Sql class using the INotifyPropertyChanging event and refelction.

After adding the class and appropiate usings you will be able to get the context by simple typing:

NorthwindDataContext context = new NorthwindDataContext("Data Source=(local);initial catalog=Northwind;Integrated Security=SSPI");
var product = context.Products.First();

NorthwindDataContext fetchedContext = product.GetDataContextFromMe(false);
 
QueryManager Sunday, June 17, 2007
This is a useful library to handle queries in your application. The idea is to avoid having queries built with quoted concatinated strings and store all the queries in files instead.

This query manager is able to load queries from Files and Resource assmeblies and has infrastructure to cache and invalidate the cache when a query file changes.

The implementation uses a version of the strategy and provider patterns as well as interfaced based programming and unit testing with Rhino Mocks.

The purpose of this code is educational and you can read more about the ideas in this blog post: https://lowendahl.net/showShout.aspx?id=140
 
Swedish social security number Sunday, September 18, 2005
A struct datatype that can contain and validate a swedish social security number
 
Using the implicit cast operator Tuesday, January 18, 2005
This is the complete example code for my blog about implicit cast operators.
 
Using Net Session from .NET Monday, June 21, 2004
This little neat P/Invoke piece of code will help you find information about logged on session on your box
 
Activate an external application Thursday, May 20, 2004
Using P/Invoke this little piece of code will give you the C# version of VB.NET AppActivate
 
Using threading in asp.net Wednesday, May 05, 2004
A short example on how to use a timer class from asp.net
 
Formsauthentication against active directory Wednesday, June 11, 2003
A sample asp.net example which authenticates against active directory.
 
Color Console Wednesday, June 11, 2003
Ever wanted to show flashy colors in your console application? Bother about the position of the cursor? Fear no more, you can sleep good at night after downloading this example class that does just those things
 
SQL Server Enumerator utility class Tuesday, March 04, 2003
This neat little utility let's you listen for SQL Servers broadcasting on the LAN and creates a collection containing information about them
 
Collapsable Container Server Control Tuesday, October 15, 2002
A collapsaple server control built for asp.net. This neat little control entered the ASP.NET competition at C# Summer Camp and won first place