Load() public méthode

public Load ( ) : IValidationRuleset[]
Résultat IValidationRuleset[]
Exemple #1
0
        static IValidationRuleset LoadRuleset(IXmlDocumentProvider docProvider)
        {
            // Load some rulesets
            XmlValidationRulesetLoader loader = new XmlValidationRulesetLoader(docProvider);

            IValidationRuleset[] rulesetArray = loader.Load();
            if (rulesetArray == null)
                throw new Exception("The validation rulesets could not be loaded.  Are you sure the icalvalid schema files are present?");

            List<IValidationRuleset> rulesets = new List<IValidationRuleset>(rulesetArray);

            // Determine a validation ruleset to use
            string validatorName = "Strict_2_0";

            // Select the ruleset
            IValidationRuleset selectedRuleset = rulesets.Find(
                delegate(IValidationRuleset rs)
                {
                    return string.Equals(rs.Name, validatorName, StringComparison.CurrentCultureIgnoreCase);
                }
            );

            return selectedRuleset;
        }
        protected IValidationRuleset LoadRuleset()
        {
            // Load some rulesets
            XmlValidationRulesetLoader loader = new XmlValidationRulesetLoader(DocumentProvider);
            List<IValidationRuleset> rulesets = new List<IValidationRuleset>(loader.Load());

            // Determine a validation ruleset to use
            string validatorName = "Strict_2_0";
            /*if (_Arguments.Contains(_ValidatorArgument))
                validatorName = _Arguments[_ValidatorArgument].Value;*/

            // Select the ruleset
            IValidationRuleset selectedRuleset = rulesets.Find(
                delegate(IValidationRuleset rs)
                {
                    return string.Equals(rs.Name, validatorName, StringComparison.CurrentCultureIgnoreCase);
                }
            );

            return selectedRuleset;
        }