Bertan's Blog : VSCmdShell News Feed 
Saturday, May 03, 2008  |  From Bertan's Blog : VSCmdShell

My new team just released a new feature of Popfly website called Popfly Game Creator. In summary it is a website where you can easily create casual games most of the time without writing any code. You can then share those games with your friends. There is a detailed post about the release in Ben Anderson's blog.


I have also created a "snake" like game for fun which you can find at http://www.popfly.com/users/Bertan/WatermelonHunt.


 

Monday, January 28, 2008  |  From Bertan's Blog : VSCmdShell

For the last couple months, I was working on a feature to enable bug reporting on MSDN Forums. Last week we have started a pilot program with Visual Basic team and enabled bug reporting on several Visual Basic forums. Bug reporting procedure is very simple and all you have to do is select "Bug Report" while create a new post under an enabled forum and Microsoft will respond to your bug similart to other bugs submitted through Microsoft Connect. We believe having bug reporting integrated in MSDN Forums will make it much easier for people to submit bugs and also it will make resolutions, workarounds to the bugs much more visible.


 You can find more detailed information related to the pilot program at Visual Basic team blog.

Saturday, October 27, 2007  |  From Bertan's Blog : VSCmdShell

I have been trying to add a command filter to all text editors in Visual Studio for a project, since I had to collect information from several number of sources I wanted to collect them in one place in the hope that somebody else might find it useful.


In order to get notification when a text view is registered in Visual Studio, we first have to register an implementation of IVsTextManagerEvents as an event sink. In order to do this you can use the following code block which uses IVsTextManager service.


IVsTextManager textManager = this.GetService(typeof(SVsTextManager)) as IVsTextManager;
IConnectionPointContainer container = textManager as IConnectionPointContainer;
IConnectionPoint textManagerEventsConnection = null;
Guid eventGuid = typeof(IVsTextManagerEvents).GUID;
container.FindConnectionPoint(
ref eventGuid, out textManagerEventsConnection);
uint cookie = 0;
textManagerEventsConnection.Advise(
this, out cookie);


Now IVsTextManagerEvents.OnRegisterView method is going to be called for each new view created. In that method you can use passed IVsTextView.AddCommandFilter method to add a command filter. However, when the event is raised the window is actually not initialized fully so any command filter you add will be below the language service filters thus you won't see all of the commands. My solution to this problem was to check the text buffer each time Exec method was called on the filter and remove/add the filter once the buffer wasn't empty anymore. I am still trying to find a better solution and I will update this entry if I find anything better than relying on the buffer. One apparent problem with this solution is that as long as the text view remains empty, the filter will not be re-registered thus causing you to lose some events on empty files.

Wednesday, June 13, 2007  |  From Bertan's Blog : VSCmdShell

I was recently in a training about test driven development and in an exercise about testing legacy code, a very nice idea came up to inject mock objects to legacy code. The usual problem is that if a legacy code is not written taking testability in to account, there might a lot of hard coded dependencies to external sources such as databases which makes unit testing really difficult. In order to quickly unit test the legacy components, those dependencies should be replaced by mock objects so that unit tests won't require a deployed environment. There are several ways to do this, one way is to decide which object to use (mock or the actual component) based on the a global flag. This can be dangerous if the flag is not set to false when deploying to production environment. However by using reflection, you can avoid modifying the existing code and replacing the reference to the mock component in the unit test itself. Below is a quick code snippet in how you can achieve this:


CustomerReader reader;
Type objectType = typeof(reader);
System.Reflection.
FieldInfo field = objectType.GetField("DataLayer",
  System.Reflection.
BindingFlags.Instance |
  System.Reflection.
BindingFlags.NonPublic |
  System.Reflection.
BindingFlags.GetField);
field.SetValue(reader,
new Object());


This code snippet will change the value of reader.DataLayer which is a private field in the object. However there is one drawback to this method. The wrapper object that you are replacing must be inheritable otherwise you won't be able to create a mock object to replace the original instance. 


 

Tuesday, May 08, 2007  |  From Bertan's Blog : VSCmdShell

I have updated VSCmdShell homepage today to include latest release. This release is our first release where all contributions are from VSCmdShell community, you can check all the included fixes at Codeplex but here is a quick summary of them:



  • PowerShell RTM compatibility.

  • VSCmdShell window does not hang when it is hidden anymore.

  • International character support is added for command line host.

 

Tuesday, May 08, 2007  |  From Bertan's Blog : VSCmdShell

I have updated VSCmdShell homepage today to include latest release. This release is our first release where all contributions are from VSCmdShell community, you can check all the included fixes at Codeplex but here is a quick summary of them:

  • PowerShell RTM compatibility.
  • VSCmdShell window does not hang when it is hidden anymore.
  • International character support is added for command line host.

 

Tuesday, September 12, 2006  |  From Bertan's Blog : VSCmdShell

Yesterday, we have released a new version of VSCmdShell. This new release includes several fixes as well as some new features suggested by the community. A summary of changes are:

  • Better auto filename completion support
  • Tool window position should now be saved correctly between sessions.
  • Settings to change startup directory for VSCmdShell
  • Ability to restart VSCmdShell session without restarting Visual Studio

You can download VSCmdShell 1.1 release at CodePlex project page. If you find any bugs or if you have any suggestions please create an issue at the project page.

 Bertan's Blog : VSCmdShell News Feed 

Last edited Dec 7, 2006 at 10:16 PM by codeplexadmin, version 1

Comments

No comments yet.