Ejemplo 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);
        }
Ejemplo 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));
        }
Ejemplo 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))));
        }
Ejemplo n.º 4
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;
        }
Ejemplo 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);
        }
Ejemplo 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);
            }
        }
Ejemplo 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);
 }