Visual Studio Development Bookmark and Share   
 index > Visual Studio Guidance Automation Toolkit > Argument monitoring itself?
 

Argument monitoring itself?

Hi,

I have a recipe's argument that I want to be always in uppercase. For example, when the user enters a value for this argument through the wizard,the value should be set to uppercase in the wizard and in the argument dictionnary when the user leaves the field.

Maybe it wasn't a good approach, but I tried to add a ValueProvider to my argument that monitors itself, so that when the value changes, the ValueProvider is called and the argument is set to uppercase, but of course, it didn't work!

The error message that the RecipeFramework gave me was :

Value provider FrameworkGuidancePackage.ValueProviders.UpperCaseValueProvider, FrameworkGuidancePackage can't monitor the same argument it's attached to (argument ApplicationCode).

Here is the code I wrote for the argument (that didn't work):

<Argument Name="ApplicationCode">

<ValueProvider Type="FrameworkGuidancePackage.ValueProviders.UpperCaseValueProvider, FrameworkGuidancePackage">

<MonitorArgument Name="ApplicationCode"/>

</ValueProvider>

</Argument>

Can someone tell me the right way to do it? Smile

Phil

Philippe Trottier  Thursday, January 10, 2008 6:24 PM

As you did find out you can't have an argument monitoring itself. You will need to create a 2nd argument, eg. "ApplicationCodeUppercase" that will be monitoring the original one.

Another option could be to stick with a single argument and use a type converter, eg. "UppercaseStringConverter" that will only accept strings in uppercase, this one looks like a nicer approach...

HTH,
-Victor.
vga  Monday, January 14, 2008 6:31 AM

As you did find out you can't have an argument monitoring itself. You will need to create a 2nd argument, eg. "ApplicationCodeUppercase" that will be monitoring the original one.

Another option could be to stick with a single argument and use a type converter, eg. "UppercaseStringConverter" that will only accept strings in uppercase, this one looks like a nicer approach...

HTH,
-Victor.
vga  Monday, January 14, 2008 6:31 AM

Hi!

The second option is nicer than the first one, except that I want the wizard to "automate" the uppercase. Sothe first option, in this case, would be the best solution.. If there is no better way to do it.

Thank you for your answer!

Phil

Philippe Trottier  Monday, January 14, 2008 1:55 PM

You can use google to search for other answers

Custom Search

More Threads

• Create a single file generation that use T4 template
• Any tutorial for GAT?
• Effort in creating class recipe
• Project Type "Service Factory: Modeling Edition" not found under Guidance Packages
• Error 1001: Item has already been added. Key in dictionary
• Passing argument between wizards (with custom TypeConverters)
• How do I add an empty project folder?
• Deploying Guidance Package
• GAT in VB.NET?
• Problem Using Newly Created Guidance package in VS 2005