public PluginProfileErrorCollection ValidateUpdate(MashupManagerProfile profile)
		{
			var errors = new PluginProfileErrorCollection();

			ValidateNameNotEmpty(errors);
			ValidateNameContainsOnlyValidChars(errors);

			return errors;
		}
        public PluginProfileErrorCollection ValidateUpdate(MashupManagerProfile profile)
        {
            var errors = new PluginProfileErrorCollection();

            ValidateNameNotEmpty(errors);
            ValidateNameContainsOnlyValidChars(errors);

            return(errors);
        }
Exemplo n.º 3
0
		protected void ValidateNameUniqueness(PluginProfileErrorCollection errors, MashupManagerProfile profile)
		{
			if (errors.Any())
				return;

			var existsSuchName = profile != null && profile.MashupNames
															.Any(
																m => m.Equals(Name, StringComparison.InvariantCultureIgnoreCase));

			if (existsSuchName)
			{
				errors.Add(new PluginProfileError
				{
					FieldName = NameField,
					Message = "Mashup with the same name already exists"
				});
			}
		}
Exemplo n.º 4
0
        protected void ValidateNameUniqueness(PluginProfileErrorCollection errors, MashupManagerProfile profile)
        {
            if (errors.Any())
            {
                return;
            }

            var existsSuchName = profile != null && profile.MashupNames
                                 .Any(
                m => m.Equals(Name, StringComparison.InvariantCultureIgnoreCase));

            if (existsSuchName)
            {
                errors.Add(new PluginProfileError
                {
                    FieldName = NameField,
                    Message   = "Mashup with the same name already exists"
                });
            }
        }
		private void UpdateProfile(MashupManagerProfile managerProfile)
		{
			var addOrUpdateProfileCommand = ObjectFactory.GetInstance<AddOrUpdateProfileCommand>();
			var profileDto = new PluginProfileDto
			{
				Name = ProfileName,
				Settings = managerProfile
			};
			addOrUpdateProfileCommand.Execute(profileDto.Serialize(), null);
		}