public void InitializeValidator() { var originalGroup = this.AddNewGroup(NameValidatorTestLab <IGroup> .ORIGINAL_NAME); var validator = new GroupNameValidator(this.Persistence); this.testLab = new NameValidatorTestLab <IGroup>(validator, originalGroup, GroupNameValidator.NOT_UNIQUE); }
internal bool ValidateGroupName(TextBox txtGroupName) { string groupName = txtGroupName.Text; string message = new GroupNameValidator(this.persistence).ValidateNew(groupName); this.form.SetErrorInfo(txtGroupName, message); return(string.IsNullOrEmpty(message)); }
private IEnumerable <string> SelectValidGroupNames(FavoriteConfigurationElement toImport) { var validator = new GroupNameValidator(this.persistence); var tagsConverter = new TagsConverter(); return(tagsConverter.ResolveTagsList(toImport) .Where(groupName => string.IsNullOrEmpty(validator.ValidateNameValue(groupName)))); }
private static string ValidateNewGroupName(IPersistence persistence, string newGroupName) { string message = new GroupNameValidator(persistence).ValidateNew(newGroupName); if (string.IsNullOrEmpty(message)) return newGroupName; MessageBox.Show(message, "New Group name is not valid", MessageBoxButtons.OK, MessageBoxIcon.Error); return string.Empty; }
private static string ValidateNewGroupName(IPersistence persistence, string newGroupName) { string message = new GroupNameValidator(persistence).ValidateNew(newGroupName); if (string.IsNullOrEmpty(message)) { return(newGroupName); } MessageBox.Show(message, "New Group name is not valid", MessageBoxButtons.OK, MessageBoxIcon.Error); return(string.Empty); }
private void SheduleRename(IGroup group, NodeLabelEditEventArgs e) { var groupValidator = new GroupNameValidator(this.persistence); string errorMessage = groupValidator.ValidateCurrent(group, e.Label); if (string.IsNullOrEmpty(errorMessage)) { var groupArguments = new object[] { group, e.Label }; this.favsTree.BeginInvoke(new Action <IGroup, string>(this.RenameGroup), groupArguments); } else { e.CancelEdit = true; MessageBox.Show(errorMessage, "Group name is not valid", MessageBoxButtons.OK, MessageBoxIcon.Error); } }
private void SheduleRename(IGroup group, NodeLabelEditEventArgs e) { var groupValidator = new GroupNameValidator(this.Persistence); string errorMessage = groupValidator.ValidateCurrent(group, e.Label); if (string.IsNullOrEmpty(errorMessage)) { var groupArguments = new object[] { group, e.Label }; this.favsTree.BeginInvoke(new Action<IGroup, string>(this.RenameGroup), groupArguments); } else { e.CancelEdit = true; MessageBox.Show(errorMessage, "Group name is not valid", MessageBoxButtons.OK, MessageBoxIcon.Error); } }
internal bool ValidateGroupName(TextBox txtGroupName) { string groupName = txtGroupName.Text; string message = new GroupNameValidator(this.persistence).ValidateNew(groupName); this.form.SetErrorInfo(txtGroupName, message); return string.IsNullOrEmpty(message); }
private IEnumerable<string> SelectValidGroupNames(FavoriteConfigurationElement toImport) { var validator = new GroupNameValidator(this.persistence); return toImport.TagList.Where(groupName => string.IsNullOrEmpty(validator.ValidateNameValue(groupName))); }
public void InitializeValidator() { var originalGroup = this.AddNewGroup(NameValidatorTestLab<IGroup>.ORIGINAL_NAME); var validator = new GroupNameValidator(this.Persistence); this.testLab = new NameValidatorTestLab<IGroup>(validator, originalGroup, GroupNameValidator.NOT_UNIQUE); }