ValidateAdd() public method

public ValidateAdd ( MashupManagerProfile profile ) : PluginProfileErrorCollection
profile MashupManagerProfile
return PluginProfileErrorCollection
コード例 #1
0
		public PluginProfileErrorCollection Add(Mashup dto, bool generateUniqueName)
		{
			if (generateUniqueName)
			{
				dto.Name = GetUniqueMashupName(dto.Name);
			}

			var errors = dto.ValidateAdd(ManagerProfile);
			if (errors.Any())
			{
				return errors;
			}

			AddMashupNameToPlugin(dto.Name);
			_scriptStorage.SaveMashup(dto);
			_bus.Send(dto.CreatePluginMashupMessage());
			_log.InfoFormat("Add mashup command sent to TP (Mashup '{0}' for account '{1}')", dto.Name, _context.AccountName.Value);
			return errors;
		}
コード例 #2
0
        public PluginProfileErrorCollection Add(Mashup dto, bool generateUniqueName)
        {
            if (generateUniqueName)
            {
                dto.Name = GetUniqueMashupName(dto.Name);
            }

            var errors = dto.ValidateAdd(ManagerProfile);

            if (errors.Any())
            {
                return(errors);
            }

            AddMashupNameToPlugin(dto.Name);
            _scriptStorage.SaveMashup(dto);
            _bus.Send(dto.CreatePluginMashupMessage());
            _log.InfoFormat("Add mashup command sent to TP (Mashup '{0}' for account '{1}')", dto.Name, _context.AccountName.Value);
            return(errors);
        }