Posts Tagged Visual Studio .Net 2005

Steeve’s BlendPanel

A colleague of mine wrote a small, but very nice component called “BlendPanel” I know there are already versions, but anyways it’s a very nice component.I’ve added it as an attachment to this post, as well as a test project that you can use to play a bit with it. So thanks to Steeve for making it available to the public.

BlendPanel test application.

2 Comments

DesignMode + UserControls = HELL!!!

Today I had to work with some usercontrols in our project. The problem was that we do some database access from within the constructor. For all this to work well everything needs to be in the right place and configured correctly which is not the case in design mode. So when I tried to open a user control at design time I got various errors because there were exceptions accessing the database and so on… You get the point.

I wanted to solve this by adding the if Not Me.DesignMode then statement so the database code would not be called at design time. I started replacing all the code in the user controls only to discover that it doesn’t work.

What was the problem? Well it seems that when you have a user control the DesignMode property is not reliable. First off all its always false in a constructor or any code called from within the constructor. The false or true value for the DesignMode property is set when the control is sited (ISite interface) the only problem is that this happens after construction.

An other problem is nested controls. When you have a user control in an other user control or form and you debug it at design time the nested control will always indicate that it is not in DesignMode. Pretty annoying,no?

After some searching on the web and having viewed multiple solutions I found a solution that will solve in my case both problems mentioned above.

It has nothing to do with the control or it’s DesignMode property. I found that in the namespace System.ComponentModel there is a class called LicenseManager that has a property UsageMode. This property has got 2 possible values Runtime and Designtime. You can use this instead of the DesignMode property to check if you are running in design or at runtime because it will return you the correct state already in constructor code. An other advantage is that it can be used in nested user controls because it is not dependent on the control to set the correct value this way you can also use it correctly there.

Nice isn’t it? For me it does the trick, it might be still possible that there are some issues with this way of working, but I haven’t experienced any problems yet…

19 Comments

UPDATE #3: TFSProxy

As promised I’ve put the first release for the TFSProxy add-in online at the codeplex project (http://www.codeplex.com/tfsproxy).

,

No Comments

UPDATE #2: TFSProxy

I’ve been busy with cleaning out the code and working on a graphics improvement so that it also looks nice (this is a personal view ofcourse).

When all this is done I will also be rebuilding the setup project and then upload it to the codeplex for download.

So what’s included in this version:

  • Autoconfiguration using the webservice (not included in the setup, download seperately)
  • Switching between locations retrieved from the autoconfig
  • Turning off the TFS Proxy
  • Enable/disable the behaviour for the dialog to appear at vs.net startup.

The big thing that is missing is the ability to add/edit/remove locations. Although this is not available using a GUI you can edit the xml by hand.More details on how to do this will be published later on.

,

No Comments

UPDATE: TFSProxy

Just a small update to say I’ve put the project on codeplex back online (http://www.codeplex.com/tfsproxy). I still have to put the screenshots back and eventually I will also keep the deadline for the first release planned on February 19, 2007.

I’ve also been mentioned on the following blogs:

Richard Berg’s blog: http://blogs.msdn.com/richardb/archive/2007/02/01/new-tfs-tool-tfsproxy.aspx
Anthony Borton’s blog: http://myvstsblog.com/archive/2007/02/01/TFS-Proxy-Add_2D00_in-and-other-VSTS_2F00_TFS-Widgets.aspx

,

No Comments

Tips & Tricks: Run Console Applications in Visual Studio .Net that doesn’t exit when finished

Most of you might already know this little trick, but for those of you that don’t know it yet it’s very handy.

We often create small console applications to test some piece of code or implementation. We will often use the Console.WriteLine and Console.Write to display the results. Now when you debug your console application it will exit when the code is executed which will make it difficult for you to review the results that have been written to the console. One solution is to add the line Console.ReadLine at the end of the code so that the application waits for the user to press enter and then it will exit.

Another faster solution is instead of pressing F5 you can also press CTRL + F5. Using this method your application will be started and when the code is executed it will put the Console into a Pauze. For those of you that are familiar with Batch files it’s the same effect as adding a pauze keyword.

No Comments

TFSProxy Visual Studio .net 2005 Add-in

I’m currently developing an add-in for visual studio that allows you to switch fast between different Team Foundation Proxy Servers or disable the proxy servers without the need of going in the options of visual studio .net.

In the first release the user will be able to switch and disable proxy servers. It will also be possible to add new configurations, edit and delete existing configurations.

As a plus I also developed a web service through which the user can get predefined configurations. The user will not be able to change or remove these settings directly. This might be handy in an enterprise scenario where different proxy servers are used and they are controlled by System Operations.

For more information go to my Codeplex Project

,

No Comments