June 17, 2010 9:49 PM | Comments [3] | by Ed Blankenship
I’ve been hitting my head against the table today trying to have a nice experience for editing a collection of string values as a custom build process parameter in my TFS 2010 build definition. The problem comes with what editor is actually used to edit the process parameter at design time. You can specify a custom editor for any of your custom build process parameters which is really handy but I needed the ability to use editors that were out of the box but still provided a sufficient experience to the end user.
My journey towards a solution…
I began really wanting to have one build process parameter that had the type of Dictionary<string, string>. That didn’t work out so well because when I went to edit it in my build definition, I received this editor and the add/remove members buttons.
I gave up on the Dictionary<T, T> approach and decided that I could handle it by specifying two collections of type Collection<string>. I also attempted to try List<string> and even a String[] but ended up with this editor that seemed to not like System.String.
I found Microsoft.TeamFoundation.Build.Workflow.Activities.StringList. It is a custom type that is known to Team Build 2010 and even has a custom editor that is registered to it that shows up. That editor is Microsoft.TeamFoundation.Build.Controls.WpfStringListEditor. Works great for me! Take a look:
Ed Blankenship
New Microsoft.TeamFoundation.Build.Workflow.Activities.StringList({"UnitTests", "IntegrationTests"})
Remember Me
a@href@title, b, blockquote@cite, em, i, strike, strong, sub, sup, u