public PluginProfileErrorCollection Delete(string name)
		{
			DeleteMashupNameToPlugin(name);

			_scriptStorage.DeleteMashup(name);

			var dto = new MashupDto {Name = name};

			_bus.Send(dto.CreatePluginMashupMessage());

			_log.InfoFormat("Clean mashup commnad sent to TP (Mashup '{0}' for account '{1}')", dto.Name, _context.AccountName.Value);

			return new PluginProfileErrorCollection();
		}
        public PluginProfileErrorCollection Add(MashupDto dto)
        {
            NormalizeMashup(dto);
            var errors = dto.ValidateAdd(ManagerProfile);

            if (!errors.Any())
            {
                AddMashupNameToPlugin(dto);

                _scriptStorage.SaveMashup(dto);

                _bus.Send(dto.CreatePluginMashupMessage());

                _log.InfoFormat("Add mashup commnad sent to TP (Mashup '{0}' for account '{1}')", dto.Name, _context.AccountName.Value);
            }
            return errors;
        }
 private void NormalizeMashup(MashupDto mashup)
 {
     mashup.Name = mashup.Name.Trim();
 }
 private void AddMashupNameToPlugin(MashupDto dto)
 {
     var names = ManagerProfile != null ? ManagerProfile.MashupNames : new MashupNames();
     names.Add(dto.Name);
     CreateOrUpdateProfile(names);
 }