• 设为首页
  • 点击收藏
  • 手机版
    手机扫一扫访问
    迪恩网络手机版
  • 关注官方公众号
    微信扫一扫关注
    迪恩网络公众号

C# PluginProfileErrorCollection类代码示例

原作者: [db:作者] 来自: [db:来源] 收藏 邀请

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



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


示例16: Validate

        public void Validate(PluginProfileErrorCollection errors)
        {
            ValidateNameIsNotEmpty(errors);

            ValidateNameHasValidCharacters(errors);

            ValidateSettings(errors);
        }
开发者ID:FarReachJason,项目名称:Target-Process-Plugins,代码行数:8,代码来源:ProfileDtoValidator.cs


示例17: CheckRevision

		public override void CheckRevision(RevisionId revision, PluginProfileErrorCollection errors)
		{
			TfsRevisionId revisionId = revision;
			if (Int32.Parse(revisionId.Value) <= 0 || Int32.Parse(revisionId.Value) > Int32.MaxValue)
			{
				_errorResolver.HandleConnectionError(new InvalidRevisionException(), errors);
			}
		}
开发者ID:lakshithagit,项目名称:Target-Process-Plugins,代码行数:8,代码来源:TfsVersionControlSystem.cs


示例18: ValidateMapperData

		public void ValidateMapperData(PluginProfileErrorCollection errors)
		{
			ValidateResultsFilePathForMapping(errors);
			ValidateProject(errors);
			ValidateTestPlan(errors);
			ValidateFramework(errors);
			ValidateRegExp(errors);
		}
开发者ID:lakshithagit,项目名称:Target-Process-Plugins,代码行数:8,代码来源:TestRunImportPluginProfile.cs


示例19: ValidateSettings

 private void ValidateSettings(PluginProfileErrorCollection errors)
 {
     var settings = _dto.Settings as IValidatable;
     if (settings != null)
     {
         settings.Validate(errors);
     }
 }
开发者ID:FarReachJason,项目名称:Target-Process-Plugins,代码行数:8,代码来源:ProfileDtoValidator.cs


示例20: Validate

		public void Validate(PluginProfileErrorCollection errors)
		{
			var logger = ObjectFactory.TryGetInstance<IActivityLogger>();
			if (logger != null)
			{
				logger.Info("validation is in progress");
			}
		}
开发者ID:TargetProcess,项目名称:Target-Process-Plugins,代码行数:8,代码来源:SampleProfileSerialized.cs



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


鲜花

握手

雷人

路过

鸡蛋
该文章已有0人参与评论

请发表评论

全部评论

专题导读
上一篇:
C# PluginResult类代码示例发布时间:2022-05-24
下一篇:
C# PluginManager类代码示例发布时间:2022-05-24
热门推荐
阅读排行榜

扫描微信二维码

查看手机版网站

随时了解更新最新资讯

139-2527-9053

在线客服(服务时间 9:00~18:00)

在线QQ客服
地址:深圳市南山区西丽大学城创智工业园
电邮:jeky_zhao#qq.com
移动电话:139-2527-9053

Powered by 互联科技 X3.4© 2001-2213 极客世界.|Sitemap