Hi,
I don´t understand completely the question.
Do you not know how you do the modification ? or Do you not know how you must implement it?
If you want to keep the original recipe file, I recommend you to create a new recipe file and new view page, and change the name to the new copied recipe.
But I think that you are asking because you don´t know how to make the modification.
You can create a duplicate of the files (to keep the original functionality):
Recipes -> CS -> CreateSmartClientFactoryView.xml
And all CustomWizardPages -> CreateViewPage -> CreateViewPage folder.
You can make a copy\paste directly from the VS.
I recommend you to change the namespaces to this files, to differentiate this new form with the original.
If you want to have minimal problem, you can only add a additional item to tne namespace, for example:
namespace Microsoft.Practices.SmartClientFactory.CustomWizardPages.<custom name>CreateViewPage
But I recommend you in the future to change the interfaces, class and form name.
Then you must add new register in the SmartClientDevelopment.xml, with the new recipe file (xml file):
<xi:include href="Recipes/CS/<custom name>CreateSmartClientFactoryView.xml"/>
In the <custom name>CreateSmartClientFactoryView.xml file, you remember to modify the recipe name:
<Recipe Name="<cusom name>CreateViewCS" >
Change the caption tag, too:
<Caption> <custom name>- Add View (with presenter)...</Caption>
In this file you need to change the Wizard tag:
<Wizard xmlns="http://schemas.microsoft.com/pag/gax-wizards" SchemaVersion="1.0" Help="ms-help://MS.VSCC.v90/MS.VSIPCC.v90/ms.practices.scsf.2008apr/SCSF/html/03-01-040-How_to_Add_a_View_with_a_Presenter.htm"> <Pages> <Page Type="Microsoft.Practices.SmartClientFactory.CustomWizardPages.<custom name>CreateViewPage.<custom name>CreateViewPage, Microsoft.Practices.SmartClientFactory.GuidancePackage"> <Title>Add View with Presenter</Title> <LinkTitle>Add View with Presenter properties</LinkTitle> </Page> </Pages> </Wizard>
You need to modify the ICreateViewPage, adding aditional property:
string CustomText { get; }
In the CreateViewPage form, you must add the property defined in the interface:
public string CustomText { get { return _customTextBox.Text; } }
The customTextBox is the name of textbox control added in the form.
In the recipe you must add :
<Argument Name="CustomText" Required="false"> <ValueProvider Type="Evaluator" Expression="" /> </Argument>
In the template code you must add new input, for example, I added the input parameter in the View.cs.t4 :
<Action Name="GenerateView" Type="TextTemplateAction" Template="Items\View.CS\View.cs.t4"> <Input Name="ClassName" RecipeArgument="ViewName" /> <Input Name="TargetNamespace" RecipeArgument="TargetNamespace" /> <Input Name="RootNamespace" RecipeArgument="RootNamespace"/> <Input Name="CustomText" RecipeArgument="CustomText"/> <Output Name="Content" /> </Action>
You can use it in the template: <#= CustomText #>
Note: You can follow the ViewName property of the wizard, because it is related to simple text control.
In the ViewName the code used event to notify changes, but in this step I don´t add these.
I hope I have been helpful.
greetings
Leandro Tuttini |