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


C# ValidationResults.AddAllResults方法代码示例

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


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

示例1: CheckLink

        public void CheckLink(ValidationResults results) {
            var validator = ValidationFactory.CreateValidator<ChangesetLink>();
            var linkResults = validator.Validate(Link);

            if(!linkResults.IsValid) {
                results.AddAllResults(linkResults);
            }
        }
开发者ID:dgruesso,项目名称:VersionOne.Integration.Bugzilla,代码行数:8,代码来源:ChangesetWriterEntity.cs

示例2: CheckProjects

        public void CheckProjects(ValidationResults results) {
            var validator = ValidationFactory.CreateValidatorFromAttributes(typeof(TestPublishProjectMapping),
                string.Empty);

            foreach (TestPublishProjectMapping project in Projects) {
                var projectResults = validator.Validate(project);
                
                if(!projectResults.IsValid) {
                    results.AddAllResults(projectResults);
                }
            }
        }
开发者ID:dgruesso,项目名称:VersionOne.Integration.Bugzilla,代码行数:12,代码来源:TestServiceEntity.cs

示例3: DoValidateSave

 public void DoValidateSave(ValidationResults results)
 {
     results.AddAllResults(
         Microsoft.Practices.EnterpriseLibrary.Validation.Validation.Validate<TrainingEstimate>(this.Training, "Save"));
     results.AddAllResults(
         Microsoft.Practices.EnterpriseLibrary.Validation.Validation.Validate<TravelEstimate>(this.Travel, "Save"));
 }
开发者ID:RonFields72,项目名称:TravelAndTraining,代码行数:7,代码来源:TravelAndTrainingRequest.cs

示例4: DoValidateEstimates

        public void DoValidateEstimates(ValidationResults results)
        {
            if (this.HasTraining)
            {
                results.AddAllResults(
                    Microsoft.Practices.EnterpriseLibrary.Validation.Validation.Validate<TrainingEstimate>(this.Training, "Estimates"));
                if (!this.Training.StartingDate.IsBetween(this.EventStart, this.EventEnd, true))
                {
                    results.AddResult(new ValidationResult(
                           "The start date is not valid.",
                           typeof(TrainingEstimate), "", "training start date", null));
                }
                if (!this.Training.EndingDate.IsBetween(this.EventStart, this.EventEnd, true))
                {
                    results.AddResult(new ValidationResult(
                           "The end date is not valid",
                           typeof(TrainingEstimate), "", "training start date", null));
                }
            }
            if (this.HasTravel)
            {
                results.AddAllResults(
                    Microsoft.Practices.EnterpriseLibrary.Validation.Validation.Validate<TravelEstimate>(this.Travel, "Estimates"));
            }

            if (this.MiscealleanousCostsComments.Length > 0 && this.MisceallaneousCosts <= 0M)
            {
                results.AddResult(new ValidationResult("General comments estimated cost is required.",
                        typeof(TravelAndTrainingRequest),
                        "", "", null));
            }
            else if (this.MisceallaneousCosts != 0M &&
                this.MiscealleanousCostsComments.Length == 0)
            {
                results.AddResult(new ValidationResult("General comments are required.",
                        typeof(TravelAndTrainingRequest),
                        "", "", null));
            }
        }
开发者ID:RonFields72,项目名称:TravelAndTraining,代码行数:39,代码来源:TravelAndTrainingRequest.cs

示例5: CanAddValidationResultsFromCollection

        public void CanAddValidationResultsFromCollection()
        {
            ValidationResults validationResults = new ValidationResults();
            validationResults.AddResult(new ValidationResult("existing 1", null, null, null, null));
            validationResults.AddResult(new ValidationResult("existing 2", null, null, null, null));
            ValidationResult[] newValidationResults = new ValidationResult[]
                {
                    new ValidationResult("new 1", null, null, null, null),
                    new ValidationResult("new 2", null, null, null, null),
                    new ValidationResult("new 3", null, null, null, null)
                };

            validationResults.AddAllResults(newValidationResults);

            IDictionary<string, ValidationResult> resultsMapping = ValidationTestHelper.GetResultsMapping(validationResults);
            Assert.AreEqual(5, resultsMapping.Count);
            Assert.IsTrue(resultsMapping.ContainsKey("existing 1"));
            Assert.IsTrue(resultsMapping.ContainsKey("existing 2"));
            Assert.IsTrue(resultsMapping.ContainsKey("new 1"));
            Assert.IsTrue(resultsMapping.ContainsKey("new 2"));
            Assert.IsTrue(resultsMapping.ContainsKey("new 3"));
        }
开发者ID:jmeckley,项目名称:Enterprise-Library-5.0,代码行数:22,代码来源:ValidationResultsFixture.cs

示例6: DoValidate

        /// <summary>
        /// Does the validate.
        /// </summary>
        /// <param name="objectToValidate">The object to validate.</param>
        /// <param name="currentTarget">The current target.</param>
        /// <param name="key">The key.</param>
        /// <param name="validationResults">The validation results.</param>
		protected override void DoValidate(object objectToValidate, object currentTarget, string key, ValidationResults validationResults)
		{
			Validator validator = new ValidationIntegrationHelper(this).GetValidator();

			if (validator != null)
			{
				ValidationResults results = validator.Validate(this);

				if (!results.IsValid)
				{
					validationResults.AddAllResults(results);
				}
			}
		}
开发者ID:WildGenie,项目名称:NetTiers,代码行数:21,代码来源:PropertyValidator.cs

示例7: CheckMandatoryFields

        public void CheckMandatoryFields(ValidationResults results) {
            var validator = ValidationFactory.CreateValidatorFromAttributes(typeof(ClearQuestField), string.Empty);

            foreach(ClearQuestField field in MandatoryFields) {
                var fieldResults = validator.Validate(field);
                
                if(!fieldResults.IsValid) {
                    results.AddAllResults(fieldResults);
                }
            }
        }
开发者ID:versionone,项目名称:VersionOne.Integration.ClearQuest,代码行数:11,代码来源:ClearQuestServiceEntity.cs

示例8: CheckPriorityMappings

        public void CheckPriorityMappings(ValidationResults results) {
            var validator = ValidationFactory.CreateValidator<ClearQuestPriorityMapping>();

            foreach(ClearQuestPriorityMapping mapping in PriorityMappings) {
                var mappingValidationResults = validator.Validate(mapping);

                if(!mappingValidationResults.IsValid) {
                    results.AddAllResults(mappingValidationResults);
                }
            }
        }
开发者ID:versionone,项目名称:VersionOne.Integration.ClearQuest,代码行数:11,代码来源:ClearQuestServiceEntity.cs

示例9: DoValidateSubmit

 public void DoValidateSubmit(ValidationResults results)
 {
     if (!this.HasFlightArrangements && !this.HasGroundArrangements && !this.HasLodgingArrangements)
         results.AddResult(new ValidationResult("At least one travel arrangement is required.",
             typeof(TravelEstimate), "", "travel arrangement", null));
     else
     {
         if (this.HasFlightArrangements)
         {
             results.AddAllResults(
                 Microsoft.Practices.EnterpriseLibrary.Validation.Validation.Validate<Airfare>(this.FlightArrangements, "Submit"));
         }
         if (this.HasGroundArrangements)
         {
             results.AddAllResults(
                  Microsoft.Practices.EnterpriseLibrary.Validation.Validation.Validate<Ground>(this.GroundArrangements, "Submit"));
         }
         if (this.HasLodgingArrangements)
         {
             results.AddAllResults(
                  Microsoft.Practices.EnterpriseLibrary.Validation.Validation.Validate<Lodging>(this.LodgingArrangements, "Submit"));
         }
     }
 }
开发者ID:RonFields72,项目名称:TravelAndTraining,代码行数:24,代码来源:TravelEstimate.cs

示例10: CheckProjectMappings

        public void CheckProjectMappings(ValidationResults results)
        {
            var validator = ValidationFactory.CreateValidator<JiraProjectMapping>();

            foreach (var mapping in ProjectMappings)
            {
                var mappingValidationResults = validator.Validate(mapping);

                if (!mappingValidationResults.IsValid)
                {
                    results.AddAllResults(mappingValidationResults);
                }
            }
        }
开发者ID:walkingriver,项目名称:VersionOne.Integration.JIRA,代码行数:14,代码来源:JiraServiceEntity.cs

示例11: DoValidateSave

 public void DoValidateSave(ValidationResults results)
 {
     results.AddAllResults(
             Microsoft.Practices.EnterpriseLibrary.Validation.Validation.Validate<Airfare>(this.FlightArrangements, "Save"));
      results.AddAllResults(
              Microsoft.Practices.EnterpriseLibrary.Validation.Validation.Validate<Ground>(this.GroundArrangements, "Save"));
      results.AddAllResults(
              Microsoft.Practices.EnterpriseLibrary.Validation.Validation.Validate<Lodging>(this.LodgingArrangements, "Save"));
 }
开发者ID:RonFields72,项目名称:TravelAndTraining,代码行数:9,代码来源:TravelEstimate.cs

示例12: CheckPriorityMappings

        public void CheckPriorityMappings(ValidationResults results) {
            var validator = ValidationFactory.CreateValidatorFromAttributes(typeof(QCPriorityMapping), string.Empty);

            foreach(QCPriorityMapping mapping in PriorityMappings) {
                results.AddAllResults(validator.Validate(mapping));                
            }
        }
开发者ID:versionone,项目名称:VersionOne.Integration.HPALM,代码行数:7,代码来源:QCServiceEntity.cs

示例13: CheckConnection

 public void CheckConnection(ValidationResults results) {
     var validator = ValidationFactory.CreateValidatorFromAttributes(typeof(QCConnection), string.Empty);
     var defectFilterResults = validator.Validate(Connection);
     results.AddAllResults(defectFilterResults);
 }
开发者ID:versionone,项目名称:VersionOne.Integration.HPALM,代码行数:5,代码来源:QCServiceEntity.cs

示例14: CheckDefectFilters

        public void CheckDefectFilters(ValidationResults results) {
            var validator = ValidationFactory.CreateValidatorFromAttributes(typeof(QCDefectFilter), string.Empty);

            foreach(QCDefectFilter filter in DefectFilters) {
                results.AddAllResults(validator.Validate(filter));
            }
        }
开发者ID:versionone,项目名称:VersionOne.Integration.HPALM,代码行数:7,代码来源:QCServiceEntity.cs

示例15: CheckProjects

        public void CheckProjects(ValidationResults results) {
            var validator = ValidationFactory.CreateValidatorFromAttributes(typeof(QCProject), string.Empty);

            foreach(QCProject project in Projects) {
                results.AddAllResults(validator.Validate(project));
            }
        }
开发者ID:versionone,项目名称:VersionOne.Integration.HPALM,代码行数:7,代码来源:QCServiceEntity.cs


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