public PluginProfileErrorCollection Update(UpdateMashupCommandArg commandArg)
		{
			if (commandArg.IsNameChanged())
			{
				CompleteWithNotChangedOriginFiles(commandArg);
				var addErrors = Add(commandArg, false);

				if (!addErrors.Any())
				{
					var deleteErrors = Delete(commandArg.OldName);
					foreach (var error in deleteErrors)
					{
						addErrors.Add(error);
					}
				}

				return addErrors;
			}

			return UpdateInternal(commandArg);
		}
		private void CompleteWithNotChangedOriginFiles(UpdateMashupCommandArg commandArg)
		{
			var originMashup = _scriptStorage.GetMashup(commandArg.OldName);
			var filesToBeAdded = originMashup.Files
				.Where(x => !commandArg.Files.Any(y => y.FileName.Equals(x.FileName, StringComparison.InvariantCultureIgnoreCase)))
				.ToArray();

			if (filesToBeAdded.Any())
			{
				commandArg.Files.AddRange(filesToBeAdded);
			}
		}
		private PluginProfileErrorCollection UpdateInternal(UpdateMashupCommandArg commandArg)
		{
			var errors = commandArg.ValidateUpdate(ManagerProfile);
			if (errors.Any())
			{
				return errors;
			}
			CompleteWithNotChangedOriginFiles(commandArg);
			var saveErrors = MashupScriptStorageOperations.Save(_scriptStorage, commandArg);
			if (saveErrors.Any())
			{
				return saveErrors;
			}
			_bus.Send(commandArg.CreatePluginMashupMessage());
			_log.InfoFormat("Update mashup commnad sent to TP (Mashup '{0}' for account '{1}')", commandArg.Name, _context.AccountName.Value);
			return new PluginProfileErrorCollection();
		}