Playing Chicken With Common Sense

Okay so the title makes no sense but that’s alright because I understand it and that’s all that matters.  haha Just kidding…  Take it easy… Let’s say you have a WPF application with a DataGrid on it.  You also have a strongly typed list of objects &nda... [More]
  • 1 Comments
  • E-mail
  • Kick it!
  • Shout it
  • Bookmark and Share

I am working on a WPF project at work and we purchased a couple components from a couple of different component vendors.  One of them is ComponentOne and we have used the C1DataGrid in several places.  Recently a bug was submitted that said they could not tab or shift tab through the grid ... [More]
  • 2 Comments
  • E-mail
  • Kick it!
  • Shout it
  • Bookmark and Share

Subversion is awesome I am a big fan of source control and subversion is my favorite.  I used it for several years before being forced into using TFS on my current project.  Subversion is great because it really doesn’t get in your way.  You hardly notice the code is under sour... [More]
  • 1 Comments
  • E-mail
  • Kick it!
  • Shout it
  • Bookmark and Share

Using Type Alias

I am surprised how many people still don't know they can alias namespaces using the C# keyword using.  Resharper automatically adds this syntax for me and it seems like 1 person a month says that didn't know. 1: using Short = Company.Project.Task.Function; The reason for this p... [More]
  • 1 Comments
  • E-mail
  • Kick it!
  • Shout it
  • Bookmark and Share

Let's say you have a generic class with a new() constraint on the type parameter. This means that you are allowed to create new objects of the generic type, like this: 1: class GenericClass<T> where T : new() 2: { 3: public void SomeMethod() 4: { 5: ... [More]
  • 0 Comments
  • E-mail
  • Kick it!
  • Shout it
  • Bookmark and Share

Have you ever has to remote into a machine or server only to get an error of "The terminal serve has exceeded the maximum number of allowed connections." (shown below)   This limitation set by Windows, but can be easily overridden by using the command prompt. Go to Start > Run Type ... [More]
  • 1 Comments
  • E-mail
  • Kick it!
  • Shout it
  • Bookmark and Share

Generic C# Singleton goodness

  Here is a Generic Singleton factory. Enjoy! // this is the class for which I want to maintain a single instancepublic class MyClass{ private MyClass() { // private constructor ensures that callers cannot instantiate an object using new() }} // Singleton fac... [More]
  • 0 Comments
  • E-mail
  • Kick it!
  • Shout it
  • Bookmark and Share

Escape XML string in C#

This is a simple way of escaping special characters inside of strings that you might want to insert into XML.  I have used other techniques which require more coding so keep this handy! You will use the following method: SecurityElement.Escape(string text). see MSDN documentation
  • 0 Comments
  • E-mail
  • Kick it!
  • Shout it
  • Bookmark and Share

  Sometimes you need to resolve relative url's without ResolveUrl. If the code is executing outside a Control, for example in an IHttpHandler or business layer code somewhere that has no reference to a Control, you can't call Control.ResolveUrl. The System.Web.VirtualPathUtility class has som... [More]
  • 0 Comments
  • E-mail
  • Kick it!
  • Shout it
  • Bookmark and Share

Control panel

RecentComments

Comment RSS