当前位置: 首页>>代码示例>>C#>>正文


C# PluginProfileErrorCollection.Any方法代码示例

本文整理汇总了C#中PluginProfileErrorCollection.Any方法的典型用法代码示例。如果您正苦于以下问题:C# PluginProfileErrorCollection.Any方法的具体用法?C# PluginProfileErrorCollection.Any怎么用?C# PluginProfileErrorCollection.Any使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在PluginProfileErrorCollection的用法示例。


在下文中一共展示了PluginProfileErrorCollection.Any方法的7个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C#代码示例。

示例1: GetResponse

		private static string GetResponse(string args)
		{
			var profile = args.DeserializeProfile();
			var settings = (ConnectionSettings) profile.Settings;
			var errors = new PluginProfileErrorCollection();

			settings.ValidateConnection(errors);
			if (errors.Any())
			{
				return errors.Serialize();
			}

			CheckConnection(settings, errors);
			return errors.Any() ? errors.Serialize() : string.Empty;
		}
开发者ID:lakshithagit,项目名称:Target-Process-Plugins,代码行数:15,代码来源:CheckConnectionCommand.cs

示例2: Execute

		public void Execute(PluginProfileErrorCollection errors)
		{
			if (errors.Any())
				return;

			ExecuteConcreate(errors);
		}
开发者ID:lakshithagit,项目名称:Target-Process-Plugins,代码行数:7,代码来源:Validator.cs

示例3: CheckConnection

		public bugzilla_properties CheckConnection(BugzillaProfile profile)
		{
			var errors = new PluginProfileErrorCollection();
			try
			{
				SetServerCertificateValidationCallback(profile);

				var validators = new Queue<Validator>();

				var connectionValidator = new ConnectionValidator(profile);
				validators.Enqueue(connectionValidator);

				var scriptValidator = new ScriptValidator(profile);
				validators.Enqueue(scriptValidator);

				var responseValidator = new ResponseValidator(profile, scriptValidator);
				validators.Enqueue(responseValidator);

				var deserializeValidator = new DeserializeValidator(profile, responseValidator);
				validators.Enqueue(deserializeValidator);

				var settingsValidator = new SettingsValidator(profile, deserializeValidator);
				validators.Enqueue(settingsValidator);

				var savedQueryValidator = new SavedQueryValidator(profile);
				validators.Enqueue(savedQueryValidator);

				while (validators.Count > 0)
				{
					var validator = validators.Dequeue();
					validator.Execute(errors);
				}

				if (errors.Any())
				{
					throw new BugzillaPluginProfileException(profile, errors);
				}

				return deserializeValidator.Data;
			}
			catch (BugzillaPluginProfileException)
			{
				throw;
			}
			catch (Exception ex)
			{
				errors.Add(new PluginProfileError
				           	{
				           		FieldName = BugzillaProfile.ProfileField,
				           		Message = string.Format("The connection with {0} is failed. {1}", profile, ex.Message)
				           	});
				throw new BugzillaPluginProfileException(profile, errors);
			}
		}
开发者ID:sbcfwebdev,项目名称:Target-Process-Plugins,代码行数:54,代码来源:BugzillaService.cs

示例4: Execute

		public PluginCommandResponseMessage Execute(string args, UserDTO user)
		{
			var errors = new PluginProfileErrorCollection();
			var profile = args.DeserializeProfile();
			var settings = (BugzillaProfile) profile.Settings;

			var properties = GetBugzillaProperties(settings, errors);

			return errors.Any()
			       	? new PluginCommandResponseMessage
			       	  	{PluginCommandStatus = PluginCommandStatus.Fail, ResponseData = errors.Serialize()}
			       	: new PluginCommandResponseMessage
			       	  	{PluginCommandStatus = PluginCommandStatus.Succeed, ResponseData = properties.Serialize()};
		}
开发者ID:TargetProcess,项目名称:Target-Process-Plugins,代码行数:14,代码来源:CheckConnectionCommand.cs

示例5: CheckVersions

		private static void CheckVersions(bugzilla_properties bugzillaProperties, PluginProfileErrorCollection errors)
		{
			if (!ScriptVersionIsValid(bugzillaProperties.script_version))
			{
				errors.Add(
					new PluginProfileError
						{
							Message = string.Format(
								TP2_CGI_IS_NOT_SUPPORTED_BY_THIS_PLUGIN,
								string.IsNullOrEmpty(bugzillaProperties.script_version) ? "undefined" : bugzillaProperties.script_version),
							AdditionalInfo = ValidationErrorType.InvalidTpCgiVersion.ToString()
						});
			}

			if (!errors.Any() && !BugzillaVersionIsSupported(bugzillaProperties.version))
			{
				errors.Add(new PluginProfileError
				           	{
				           		Message = string.Format(
				           			BUGZILLA_VERSION_IS_NOT_SUPPORTED_BY_PLUGIN,
				           			bugzillaProperties.version),
									AdditionalInfo = ValidationErrorType.InvalidBugzillaVersion.ToString()
				           	});
			}

			if (!errors.Any() && !ScriptSupportsProvidedBugzillaVersion(bugzillaProperties.version, bugzillaProperties.supported_bugzilla_version))
			{
				errors.Add(new PluginProfileError
				           	{
								Message = string.Format(
									BUGZILLA_VERSION_IS_NOT_SUPPORTED_BY_TP2_CGI,
									bugzillaProperties.version),
								AdditionalInfo = ValidationErrorType.InvalidTpCgiVersion.ToString()
							});
			}
		}
开发者ID:lakshithagit,项目名称:Target-Process-Plugins,代码行数:36,代码来源:SettingsValidator.cs

示例6: ValidateNameUniqueness

		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"
				});
			}
		}
开发者ID:lakshithagit,项目名称:Target-Process-Plugins,代码行数:18,代码来源:Mashup.cs

示例7: GetBugzillaProperties

		public BugzillaProperties GetBugzillaProperties(BugzillaProfile profile, PluginProfileErrorCollection errors)
		{
			profile.ValidateCredentials(errors);

			if (!errors.Any())
			{
				try
				{
					_logger.Info("Checking connection");
					var bugzillaProperties = new BugzillaService().CheckConnection(profile);
					_logger.Info("Connection success");
					return new BugzillaProperties(bugzillaProperties);
				}
				catch (BugzillaPluginProfileException e)
				{
					e.ErrorCollection.ForEach(errors.Add);
					_logger.WarnFormat("Connection failed: {0}", e);
				}
			}

			return null;
		}
开发者ID:TargetProcess,项目名称:Target-Process-Plugins,代码行数:22,代码来源:CheckConnectionCommand.cs


注:本文中的PluginProfileErrorCollection.Any方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。