Bloom.CollectionCreating.CollectionNameControl._textLibraryName_TextChanged C# (CSharp) Method

_textLibraryName_TextChanged() protected method

protected _textLibraryName_TextChanged ( object sender, EventArgs e ) : void
sender object
e EventArgs
return void
        protected void _textLibraryName_TextChanged(object sender, EventArgs e)
        {
            bool nameIsOK = GetNameIsOk();
            _setNextButtonState(this, nameIsOK);
            if (nameIsOK)
            {
            //				string[] dirs = Path.GetDirectoryName(_collectionInfo.PathToSettingsFile).Split(Path.DirectorySeparatorChar);
            //				if (dirs.Length > 2)
            //				{
            //					htmlLabel1.ColorName = "gray";
            //					string root = Path.Combine(dirs[dirs.Length - 3], dirs[dirs.Length - 2]);
            //					htmlLabel1.HTML = String.Format("Collection will be created at: {0}",
            //													Path.Combine(root, dirs[dirs.Length - 1]));
            //				}

                htmlLabel1.ForeColor = Color.Gray;
                htmlLabel1.HTML = String.Format(LocalizationManager.GetString("NewCollectionWizard.CollectionWillBeCreatedAt","Collection will be created at: {0}"),
                                _collectionInfo.PathToSettingsFile);
            }
            else
            {
                if (_collectionNameControl.Text.Length > 0)
                {
                    htmlLabel1.ForeColor = Color.Red;
                    if (DestinationAlreadyExists)
                    {
                        htmlLabel1.HTML = string.Format(LocalizationManager.GetString("NewCollectionWizard.AlreadyCollectionWithThatName","There is already a collection with that name, at <a href='file://{0}'>{0}</a>.\r\nPlease pick a unique name."), Path.GetDirectoryName(_collectionInfo.PathToSettingsFile));
                    }
                    else
                    {
                        htmlLabel1.HTML = LocalizationManager.GetString("NewCollectionWizard.UnableToCreateANewCollectionUsingThatName","Unable to create a new collection using that name.");
                    }
                }
                else
                {
                    htmlLabel1.HTML  = "";
                }
            }
        }