Visual Studio Development Bookmark and Share   
 index > Visual Studio Guidance Automation Toolkit > Passing argument between wizards (with custom TypeConverters)
 

Passing argument between wizards (with custom TypeConverters)

Hi,

How do i pass an argument from a previous wizard page?

The first wizard page has one input field (DataSource), whereas the next wizard page provides a list of databases given on the basis of the datasource.

The first wizard page has one input field - DataSource

<Argument Name="DataSource">

<ValueProvider Type="Evaluator" Expression="Mickey\Dev2005" />

</Argument>

The second wizard uses my customTypeConverter(AutoDalListOfDBTypeConverter ) to show the list of databases.

<Argument Name="DatabaseName">

<Converter Type="Test.Converters.AutoDalListOfDBTypeConverter, Test"/>

</Argument>

The problem is, how do I pass the DataSource value from wizardPage 1 to my custom TypeConverter for wizardPage 2?

public class AutoDalListOfDBTypeConverter : TypeConverter

{

public override TypeConverter.StandardValuesCollection GetStandardValues(ITypeDescriptorContext context)

{

m_listOfDB.Clear();

String conxString = "Data Source= " + DataSource + "; Integrated Security=SSPI;";

using (SqlConnection sqlConx = new SqlConnection(conxString))

{

sqlConx.Open();

DataTable tblDatabases = sqlConx.GetSchema("Databases");

sqlConx.Close();

foreach (DataRow row in tblDatabases.Rows)

{

m_listOfDB.Add(row["database_name"].ToString());

}

}

m_listOfDB.Sort();

return new StandardValuesCollection(m_listOfDB);

}

}

Thanks in advanced,

Nima

Nima_DK  Thursday, October 25, 2007 8:54 AM
Hi Nima,

You can use the DictionaryService as follow:

IDictionaryService dictionaryService = GetService(typeof(IDictionaryService)) as IDictionaryService;

Also you should add a MonitorArgument in DatabaseName argument in order to reload its value when the DataSource is setted.

hth
jose.

Jose Escrich  Thursday, October 25, 2007 3:16 PM
Hi Nima,

You can use the DictionaryService as follow:

IDictionaryService dictionaryService = GetService(typeof(IDictionaryService)) as IDictionaryService;

Also you should add a MonitorArgument in DatabaseName argument in order to reload its value when the DataSource is setted.

hth
jose.

Jose Escrich  Thursday, October 25, 2007 3:16 PM

You can use google to search for other answers

Custom Search

More Threads

• Has anyone written a MSI bootstrapper for Guidance Automation Toolkit (GAT)?
• GAT/GAX for VS2005 RTM released!
• Guidance Package Build
• Access Denied Error while installing custom Guidance package
• Recipe Framework Error when created SCSF project
• Argument in a Recipe, how to access them from a custom page
• Exception thrown on Register SCSF
• Extending Designer Toolbox
• Synchronizing - GAT Package Changes
• Tom, I see what has been keeping you busy post the E.L.