public void SetNextButtonState(UserControl caller, bool enabled)
{
wizardControl1.SelectedPage.AllowNext = enabled;
if (caller is KindOfCollectionControl)
{
_kindOfCollectionPage.NextPage = _collectionInfo.IsSourceCollection
? _collectionNamePage
: _vernacularLanguagePage;
if(_collectionInfo.IsSourceCollection)
{
_collectionInfo.Language1Iso639Code = "en";
}
}
if (caller is LanguageIdControl)
{
var pattern = L10NSharp.LocalizationManager.GetString("NewCollectionWizard.NewBookPattern", "{0} Books", "The {0} is replaced by the name of the language.");
// GetPathForNewSettings uses Path.Combine which can fail with certain characters that are illegal in paths, but not in language names.
// The characters we ran into were two pipe characters ("|") at the front of the language name.
var tentativeCollectionName = string.Format(pattern, _collectionInfo.Language1Name);
var sanitizedCollectionName = tentativeCollectionName.SanitizePath('.');
_collectionInfo.PathToSettingsFile = CollectionSettings.GetPathForNewSettings(DefaultParentDirectoryForCollections, sanitizedCollectionName);
// An earlier version went direct to finish if the proposed name was OK (unless DefaultCollectionPathWouldHaveProblems || (tentativeCollectionName != sanitizedCollectionName))
// but per BL-2649 we now want to always let the user check the name.
_languageLocationPage.NextPage = _collectionNamePage;
}
}