Sometimes we are using the same patterns of code over and over again. Those of us who are lazy (but smart) will create their own code snippets, if you are not familiar with this subject, read about how to create code snippets easily. But what if we need to create lots of classes with the same pattern? Code snippets may not be enough because they lack of some functionality which is needed to achieve our goal. Consider the following code:
abstract class FourWheelsVehicle : IVehicle
{
abstract public double MaxVelocity { get; }
abstract public string Manufacturer { get; }
abstract public double Price { get; }
abstract public int YearManufactured { get; }
virtual public int NumberOfWheels
{
get { return 4; }
}
}
An abstract class called FourWheelsVehicle implements the IVehicle interface (which is not presented here because it is not important for our matter). Our task is to create classes which represent each and every existing 4 wheels vehicle, there is a lot of work to do, a huge amount of work. So, I started by implementing Mazda6 class:
Continue Reading...
This is a guest post written by John Daniel-Trask from Mindscape.
Mindscape have released a major upgrade to their LightSpeed domain modelling / ORM tool. Version 2.0 includes a visual model designer integrated into Visual Studio, LINQ support, and the ability to access multiple databases concurrently. LightSpeed is a small, fast domain modeling tool which uses convention over configuration to perform object-relational mapping without the need for complex mapping files.
In the past it’s been necessary to code LightSpeed models explicitly in C# or Visual Basic, but the new Visual Studio-hosted designer enables a more data-centric approach: developers can drag tables from Server Explorer and LightSpeed automatically creates the models for them. Developers can also add validations and tune performance parameters such as caching and lazy/eager loading through the designer. The designer also supports a “round-tripping” approach whereby changes to the database can be applied incrementally to the…
Continue Reading...
Every one of us, software developers, experienced situations where the .Net Framework could not locate an assembly and ended up facing the TypeLoadException. These failures usually happen due to an assembly deployed to the wrong location or a mismatch in version numbers or cultures. A quick way to check what went wrong is to open the module window (Visual Studio) during debugging but that may be sometimes impossible or inconvenient because:
-
We may not have Visual Studio installed.
-
We installed the product in the customer site and we don’t have the code available.
-
It is some third party assemblies which causes the problems.
Luckily, there is an assembly binding log viewer which displays information that helps us diagnose why the .NET Framework can not locate an assembly at run time. This tool is called
Continue Reading...
After publishing 10 Visual Studio shortcuts you must know and then 11 more Visual Studio shortcuts, a colleague of mine, Elan Kynsky, introduced me an MSDN page called Visual Studio 2005 IDE Tips and Tricks. This is a long article where you can learn
a couple of useful things about Visual Studio, but what attracted me most, was the “Creating a keyboard shortcuts cheat sheet” section.
As we all know, there are a lot of keyboard shortcuts in Visual Studio. We mentioned only 21 of them here at Dev102.com but according to this article, there are about 450 shortcuts available. That fact, made me realize that I know less than 10% of them… Fortunately, we can write a macro that enumerate all of the available shortcuts. To achieve that goal, go to Tools->Macros->”Macros IDE”, a macros window will pop up, expand the MyMacros project (in the project explorer), expand MyMacros namespace and double click on Module1. Copy the following code to the Macros IDE and run it.
Continue Reading...
Here is a list of 6 Visual Studio tweaks you can do to make your development experience much better:
Show shortcut keys in screen tips:
Go to Tools->Customize and choose the Toolbars Tab. This screen pops up-

Continue Reading...
Since we got so many comments with lots of useful information on our Visual Studio Shortcuts post we decided to use those comments and some other shortcuts we found and compile another list so lets get going
Continue Reading...
This is a list of 10 great shortcuts me and my co workers use frequently, we thought you all should know too. Here they are:
CTRL + “.”: This is actually a shortcut for a shortcut. it is the same as CTRL + SHIFT + F10 which opens the smart tag window and allows you to [...]
Continue Reading...
Recently, I ran into a great free Microsoft tool which is called - Resource Refactoring Tool. This tool provides developers an easy way to extract hard coded strings from the code to resource files.
Resource files (.resx files) consists of XML entries, which specify objects and string inside XML tags. Those files can be opened with [...]
Continue Reading...
Like it or not, whoever wants to have a stable code, need to write unit tests. There are 2 main unit testing frameworks for .Net Environment: MBUnit and NUnit. During this post, I am going to focus on NUnit and its integration with Visual Studio in particular.                              Â
Once we wrote our unit tests and compiled them, [...]
Continue Reading...
This is a good one!
Every one knows that when you add a new class to a project it is private by default, but still when you compile for the first time, the compilation fails and only then you remember to add the “public” before the class name. Tired of this? Here’s what you do in [...]
Continue Reading...