コード例 #1
0
		protected static void HandleErrors(PluginProfileErrorCollection errors)
		{
			if (!errors.Empty())
			{
				throw new PluginProfileValidationException(errors);
			}
		}
コード例 #2
0
        protected override PluginCommandResponseMessage ExecuteOperation(PackageCommandArg commandArg)
        {
            var config = _libraryRepositoryConfigStorage.GetConfigs().FirstOrDefault(c => c.Name == commandArg.RepositoryName);

            if (config == null)
            {
                return(new PluginCommandResponseMessage
                {
                    PluginCommandStatus = PluginCommandStatus.Error,
                    ResponseData = "Unknown repository {0}".Fmt(commandArg.RepositoryName)
                });
            }

            ILibraryRepository           repository = _libraryRepositoryFactory.GetRepository(config);
            Mashup                       mashup     = repository.GetPackageMashup(commandArg.PackageName);
            PluginProfileErrorCollection errors     = _mashupInfoRepository.Add(mashup, true);

            return(errors.Empty()
                                       ? new PluginCommandResponseMessage {
                PluginCommandStatus = PluginCommandStatus.Succeed
            }
                                       : new PluginCommandResponseMessage
            {
                PluginCommandStatus = PluginCommandStatus.Error,
                ResponseData = errors.Aggregate("", (acc, e) => acc + e.Message + "\r\n")
            });
        }
コード例 #3
0
 protected static void HandleErrors(PluginProfileErrorCollection errors)
 {
     if (!errors.Empty())
     {
         throw new PluginProfileValidationException(errors);
     }
 }