Esempio n. 1
0
        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);
        }
Esempio n. 2
0
        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));
        }
Esempio n. 3
0
        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;
        }
Esempio n. 5
0
        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);
        }
Esempio n. 6
0
        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);
            }
        }
Esempio n. 7
0
 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);
 }