Home > Computers and Internet > Annoying VS Quirk: Interfaces & Auto-Implementation Feature

Annoying VS Quirk: Interfaces & Auto-Implementation Feature

18-Aug-05 02:32 pm EDT Leave a comment Go to comments
Anyone else find this annoying???  You go define an interface in Visual C# 2003 as follows:

public interface IMessageService

{
         

ResultsDto PerformOperation(CreateMessageDTO request);

          ResultsDto PerformOperation(ReadMessageDTO request);

          ResultsDto PerformOperation(DeleteMessageDTO request);

}

Then you go to do an implementation of the interface and type the good ‘ol colon (":") after the implementing class name and get the prompt to auto-insert all the interface members using the TAB key.  Great…hit you hit tab, and get something like:

public class MessageService : IMessageService

{

#region

IMessageService Members

public ResultsDto PerformOperation(CreateMessageDTO request)

{

          // TODO: Add MessageService.PerformOperation implementation

          return null;

}

 

ResultsDto Namespace.IMessageService.PerformOperation(ReadMessageDTO request)

{

          // TODO: Add MessageService.Namespace.IMessageService.PerformOperation implementation

          return null;

}

 

ResultsDto Namespace.IMessageService.PerformOperation(DeleteMessageDTO request)

{

          // TODO: Add MessageService.Namespace.IMessageService.PerformOperation implementation

          return null;

}

#endregion

So does anyone out there have a clue why VC# does this and whether it’s been corrected in the upcoming VS 2005 release?  Drives me batty….
Advertisements
  1. No comments yet.
  1. No trackbacks yet.

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Google+ photo

You are commenting using your Google+ account. Log Out / Change )

Connecting to %s