Пример #1
0
        private bool ValidateSchematusRule(Arya.Data.EntityData testValue)
        {
            var attribute = testValue.Attribute;

            if (attribute == null)
            {
                return(false);
            }

            var taxonomy = testValue.Sku.SkuInfos.Single(a => a.Active).TaxonomyInfo;

            if (taxonomy == null)
            {
                return(false);
            }

            var schemaInfo = taxonomy.SchemaInfos.SingleOrDefault(a => a.Attribute == attribute);

            if (schemaInfo == null)
            {
                return(Operator == "is extended");
            }

            var schemaData = schemaInfo.SchemaData;

            if (schemaData == null)
            {
                return(Operator == "is extended");
            }

            switch (Operator)
            {
            case "in schema":
                return(schemaData.InSchema);

            case "is navigation":
                return(schemaData.NavigationOrder > 0);

            case "is display":
                return(schemaData.DisplayOrder > 0);

            case "is ranked":
                return(schemaData.NavigationOrder > 0 || schemaData.DisplayOrder > 0);

            case "is extended":
                return(schemaData.Active == false);

            default:
                throw new ArgumentOutOfRangeException();
            }
        }
Пример #2
0
 // Private Methods (4) 
 private bool ValidateSpellCheckValue(Arya.Data.EntityData entityData)
 {
     if (Operator.Equals(SpellCheckOperatorsEnum.IsNotCorrect.ToString()))
     {
         //return !currentSpellChecker.GetSpellCheckEntity(entityData).Correct;
         return(true);
     }
     else if (Operator.Equals(SpellCheckOperatorsEnum.IsCorrect.ToString()))
     {
         //return currentSpellChecker.GetSpellCheckEntity(entityData).Correct;
         return(true);
     }
     else
     {
         throw new ArgumentException("Not a valid spell check orerator.");
     }
 }