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...

Here is something nice I have found while wandering around the Internet. We all know jQuery, jQuery is a Framework written in JavaScript which makes client side and DOM work much easier and faster. If you don’t know it yet, be sure to check it out, it makes Web Developers life easy on the web. Shahar wrote a great article about Calling ASP.NET WebMethod with jQuery so check it out.


Continue Reading...

It is very common to use resource files in .Net applications when you need to store some data in a XML file. I usually use .resx files as string tables in order to avoid hard coded strings in my code. Two months ago, we published a post about a free tool which helps to extract hard coded strings to resource files. Notice that when you add a resource file, there is an automatically generated class with properties issued from the resources elements, so you can call this class properties instead of using the ResourceManager. The only problem with this class is that its properties are marked as internal and thus can’t be accessed externally (from other assemblies).


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 cheatsheeta 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-

image


Continue Reading...

Visual Studio Keyboard Shortcuts 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...

Recently I found out this great add-on for Visual Studio 2008 called PowerCommands. PowerCommands Extends the functionality of Visual Studio 2008 by adding some features which we all want built into Visual Studio. PowerCommands provides the following: My favorite: Copy Reference, very useful indeed, and you all know it, just right click on the reference […]


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 […]


Continue Reading...