本文整理汇总了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"});
}
}
示例3: ValidateCommand
private void ValidateCommand(PluginProfileErrorCollection errors)
{
if(CommandName.IsNullOrWhitespace())
{
errors.Add(new PluginProfileError { FieldName = "CommandName", Message = "Command name shoud not be empty" });
}
}
示例4: ValidateTestPlan
private void ValidateTestPlan(PluginProfileErrorCollection errors)
{
if (TestPlan <= 0)
{
errors.Add(new PluginProfileError { FieldName = "TestPlan", Message = "Test Plan should be specified" });
}
}
示例5: ValidateLogin
private void ValidateLogin(PluginProfileErrorCollection errors)
{
if (Login.IsNullOrWhitespace())
{
errors.Add(new PluginProfileError { FieldName = "Login", Message = "Login should not be empty" });
}
}
示例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}")));
}
}
示例7: Execute
public void Execute(PluginProfileErrorCollection errors)
{
if (errors.Any())
return;
ExecuteConcreate(errors);
}
示例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});
}
示例9: ValidateTasksList
private void ValidateTasksList(PluginProfileErrorCollection errors)
{
if(TasksList.IsNullOrWhitespace())
{
errors.Add(new PluginProfileError { FieldName = "TasksList", Message = "Task list shoud not be empty" });
}
}
示例10: HandleErrors
protected static void HandleErrors(PluginProfileErrorCollection errors)
{
if (!errors.Empty())
{
throw new PluginProfileValidationException(errors);
}
}
示例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 });
}
示例12: ValidatePassword
private void ValidatePassword(PluginProfileErrorCollection errors)
{
if (Password.IsNullOrWhitespace())
{
errors.Add(new PluginProfileError { FieldName = "Password", Message = "Password should not be empty" });
}
}
示例13: ValidateAuthTokenUserId
private void ValidateAuthTokenUserId(PluginProfileErrorCollection errors)
{
if (AuthTokenUserId <= 0)
{
errors.Add(new PluginProfileError { FieldName = "AuthTokenUserId", Message = "User for authentication should be specified" });
}
}
示例14: ValidateProject
private void ValidateProject(PluginProfileErrorCollection errors)
{
if (Project <= 0)
{
errors.Add(new PluginProfileError { FieldName = "Project", Message = "Project should be specified" });
}
}
示例15: ValidateConnection
public void ValidateConnection(PluginProfileErrorCollection errors)
{
ValidateProtocol(errors);
ValidateMailServer(errors);
ValidatePort(errors);
ValidateLogin(errors);
ValidatePassword(errors);
}