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


C# PluginProfileErrorCollection类代码示例

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


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

示例1: HandleConnectionError

		public void HandleConnectionError(Exception exception, PluginProfileErrorCollection errors)
		{
			_log.GetLogger("Mercurial").Warn("Check connection failed", exception);
			exception = exception.InnerException ?? exception;
			const string uriFieldName = "Uri";
			if (exception is MercurialExecutionException)
			{
                errors.Add(new PluginProfileError { FieldName = "Login", Message = ExtractValidErrorMessage(exception)});
                errors.Add(new PluginProfileError { FieldName = "Password", Message = ExtractValidErrorMessage(exception) });
                errors.Add(new PluginProfileError { FieldName = uriFieldName, Message = ExtractValidErrorMessage(exception) });
				return;
			}

            if (exception is ArgumentNullException || exception is DirectoryNotFoundException)
			{
				errors.Add(new PluginProfileError{ FieldName = uriFieldName, Message = INVALID_URI_OR_INSUFFICIENT_ACCESS_RIGHTS_ERROR_MESSAGE });
			}

            if (exception is MercurialMissingException)
            {
                errors.Add(new PluginProfileError { Message = MERCURIAL_IS_NOT_INSTALLED_ERROR_MESSAGE });
            }

			var fieldName = string.Empty;
			if (exception is InvalidRevisionException)
			{
				fieldName = "Revision";
			}

			errors.Add(new PluginProfileError {FieldName = fieldName, Message = exception.Message});
		}
开发者ID:TargetProcess,项目名称:Target-Process-Plugins,代码行数:31,代码来源:MercurialCheckConnectionErrorResolver.cs

示例2: ValidateNameIsNotEmpty

 private void ValidateNameIsNotEmpty(PluginProfileErrorCollection errors)
 {
     if (_dto.Name.IsNullOrWhitespace())
     {
         errors.Add(new PluginProfileError {FieldName = "Name", Message = "Profile Name is required"});
     }
 }
开发者ID:FarReachJason,项目名称:Target-Process-Plugins,代码行数:7,代码来源:ProfileDtoValidator.cs

示例3: ValidateCommand

		private void ValidateCommand(PluginProfileErrorCollection errors)
		{
			if(CommandName.IsNullOrWhitespace())
			{
				errors.Add(new PluginProfileError { FieldName = "CommandName", Message = "Command name shoud not be empty" });
			}
		}
开发者ID:lakshithagit,项目名称:Target-Process-Plugins,代码行数:7,代码来源:TaskCreatorProfile.cs

示例4: ValidateTestPlan

		private void ValidateTestPlan(PluginProfileErrorCollection errors)
		{
			if (TestPlan <= 0)
			{
				errors.Add(new PluginProfileError { FieldName = "TestPlan", Message = "Test Plan should be specified" });
			}
		}
开发者ID:lakshithagit,项目名称:Target-Process-Plugins,代码行数:7,代码来源:TestRunImportPluginProfile.cs

示例5: ValidateLogin

		private void ValidateLogin(PluginProfileErrorCollection errors)
		{
			if (Login.IsNullOrWhitespace())
			{
				errors.Add(new PluginProfileError { FieldName = "Login", Message = "Login should not be empty" });
			}
		}
开发者ID:TargetProcess,项目名称:Target-Process-Plugins,代码行数:7,代码来源:ConnectionSettings.cs

示例6: HandleConnectionError

		private static void HandleConnectionError(SvnException e, PluginProfileErrorCollection errors)
		{
			if (e is SvnAuthorizationException)
			{
				errors.Add(ErrorFor(ConnectionSettings.LoginField, "Authorization failed"));
				errors.Add(ErrorFor(ConnectionSettings.PasswordField));
			}
			else if (e is SvnAuthenticationException || e.RootCause is SvnAuthenticationException)
			{
				errors.Add(ErrorFor(ConnectionSettings.LoginField, "Authentication failed"));
				errors.Add(ErrorFor(ConnectionSettings.PasswordField));
			}
			else if (e.Message.Contains("200 OK"))
			{
				errors.Add(ErrorFor(ConnectionSettings.UriField, "Invalid path to repository"));
			}
			else if (e is SvnRepositoryIOException)
			{
				errors.Add(ErrorFor(ConnectionSettings.UriField, "Could not connect to server"));
			}
			else if (e is SvnFileSystemException || e is SvnClientUnrelatedResourcesException)
			{
				errors.Add(ErrorFor(SubversionPluginProfile.StartRevisionField));
			}
			else
			{
				errors.Add(ErrorFor(ConnectionSettings.UriField, e.Message.Fmt("Connection failed. {0}")));
			}
		}
开发者ID:TargetProcess,项目名称:Target-Process-Plugins,代码行数:29,代码来源:SubversionErrorResolver.cs

示例7: Execute

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

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

示例8: HandleConnectionError

		public void HandleConnectionError(Exception exception, PluginProfileErrorCollection errors)
		{
			_log.GetLogger("Git").Warn("Check connection failed", exception);
			exception = exception.InnerException ?? exception;
			const string uriFieldName = "Uri";
			if (exception is TransportException)
			{
				errors.Add(new PluginProfileError {FieldName = "Login", Message = exception.Message});
				errors.Add(new PluginProfileError {FieldName = "Password", Message = exception.Message});
				errors.Add(new PluginProfileError {FieldName = uriFieldName, Message = exception.Message});
				return;
			}

			if (exception is ArgumentNullException)
			{
				errors.Add(new PluginProfileError{FieldName = uriFieldName, Message = INVALID_URI_OR_INSUFFICIENT_ACCESS_RIGHTS_ERROR_MESSAGE});
			}

			var fieldName = string.Empty;
			if (exception is JGitInternalException)
			{
				if (exception.Message.ToLower().Contains("invalid remote") || exception.Message.ToLower().Contains("uri"))
				{
					fieldName = uriFieldName;
				}
			}

			if (exception is InvalidRevisionException)
			{
				fieldName = "Revision";
			}

			errors.Add(new PluginProfileError {FieldName = fieldName, Message = exception.Message});
		}
开发者ID:lakshithagit,项目名称:Target-Process-Plugins,代码行数:34,代码来源:GitCheckConnectionErrorResolver.cs

示例9: ValidateTasksList

		private void ValidateTasksList(PluginProfileErrorCollection errors)
		{
			if(TasksList.IsNullOrWhitespace())
			{
				errors.Add(new PluginProfileError { FieldName = "TasksList", Message = "Task list shoud not be empty" });
			}
		}
开发者ID:lakshithagit,项目名称:Target-Process-Plugins,代码行数:7,代码来源:TaskCreatorProfile.cs

示例10: HandleErrors

		protected static void HandleErrors(PluginProfileErrorCollection errors)
		{
			if (!errors.Empty())
			{
				throw new PluginProfileValidationException(errors);
			}
		}
开发者ID:TargetProcess,项目名称:Target-Process-Plugins,代码行数:7,代码来源:EditProfileCommandBase.cs

示例11: HandleConnectionError

		public void HandleConnectionError(Exception exception, PluginProfileErrorCollection errors)
		{
			_log.GetLogger("Tfs").Warn("Check connection failed", exception);
			exception = exception.InnerException ?? exception;
			const string uriFieldName = "Uri";
			if (exception is TeamFoundationServiceException)
			{
				errors.Add(new PluginProfileError { FieldName = "Login", Message = exception.Message });
				errors.Add(new PluginProfileError { FieldName = "Password", Message = exception.Message });
				errors.Add(new PluginProfileError { FieldName = uriFieldName, Message = exception.Message });
				return;
			}

			if (exception is ArgumentNullException || exception is DirectoryNotFoundException)
			{
				errors.Add(new PluginProfileError { FieldName = uriFieldName, Message = INVALID_URI_OR_INSUFFICIENT_ACCESS_RIGHTS_ERROR_MESSAGE });
			}

			var fieldName = string.Empty;
			if (exception is InvalidRevisionException)
			{
				fieldName = "Revision";
			}

			errors.Add(new PluginProfileError { FieldName = fieldName, Message = exception.Message });
		}
开发者ID:TargetProcess,项目名称:Target-Process-Plugins,代码行数:26,代码来源:TfsCheckConnectionErrorResolver.cs

示例12: ValidatePassword

		private void ValidatePassword(PluginProfileErrorCollection errors)
		{
			if (Password.IsNullOrWhitespace())
			{
				errors.Add(new PluginProfileError { FieldName = "Password", Message = "Password should not be empty" });
			}
		}
开发者ID:TargetProcess,项目名称:Target-Process-Plugins,代码行数:7,代码来源:ConnectionSettings.cs

示例13: ValidateAuthTokenUserId

		private void ValidateAuthTokenUserId(PluginProfileErrorCollection errors)
		{
			if (AuthTokenUserId <= 0)
			{
				errors.Add(new PluginProfileError { FieldName = "AuthTokenUserId", Message = "User for authentication should be specified" });
			}
		}
开发者ID:lakshithagit,项目名称:Target-Process-Plugins,代码行数:7,代码来源:TestRunImportPluginProfile.cs

示例14: ValidateProject

		private void ValidateProject(PluginProfileErrorCollection errors)
		{
			if (Project <= 0)
			{
				errors.Add(new PluginProfileError { FieldName = "Project", Message = "Project should be specified" });
			}
		}
开发者ID:lakshithagit,项目名称:Target-Process-Plugins,代码行数:7,代码来源:TestRunImportPluginProfile.cs

示例15: ValidateConnection

		public void ValidateConnection(PluginProfileErrorCollection errors)
		{
			ValidateProtocol(errors);
			ValidateMailServer(errors);
			ValidatePort(errors);
			ValidateLogin(errors);
			ValidatePassword(errors);
		}
开发者ID:TargetProcess,项目名称:Target-Process-Plugins,代码行数:8,代码来源:ConnectionSettings.cs


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