Пример #1
0
        public override bool Equals(object obj)
        {
            ContextTransition other = obj as ContextTransition;

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

            if (object.ReferenceEquals(other, this))
            {
                return(true);
            }

            return(base.Equals(other) &&
                   ContextIdentifiers.SequenceEqual(other.ContextIdentifiers));
        }
Пример #2
0
 public bool IsPropertyValueValid(string propertyName, ref string errorMessageTemplate,
                                  ContextIdentifiers contextIdentifiers, string ruleId)
 {
     if (propertyName == this.GetPropertyInfo(x => x.MergedObjectType).Name&& MergedObjectType != null)
     {
         if (BaseType == null && BaseClassInfo == null)
         {
             errorMessageTemplate = "One of " + this.GetPropertyInfo(x => x.BaseType).Name + ", " +
                                    this.GetPropertyInfo(x => x.BaseClassInfo).Name + " should not be null";
             return(false);
         }
         if (TypeAttributes.FirstOrDefault(info => info is PersistentMapInheritanceAttribute) == null)
         {
             errorMessageTemplate = typeof(PersistentMapInheritanceAttribute).Name + " is required";
             return(false);
         }
     }
     return(true);
 }
Пример #3
0
 public bool IsPropertyValueValid(string propertyName, ref string errorMessageTemplate,
                                  ContextIdentifiers contextIdentifiers, string ruleId) {
     if (propertyName == this.GetPropertyInfo(x => x.MergedObjectType).Name && MergedObjectType != null) {
         if (BaseType == null && BaseClassInfo == null) {
             errorMessageTemplate = "One of " + this.GetPropertyInfo(x => x.BaseType).Name + ", " +
                                    this.GetPropertyInfo(x => x.BaseClassInfo).Name + " should not be null";
             return false;
         }
         if (TypeAttributes.FirstOrDefault(info => info is PersistentMapInheritanceAttribute) == null) {
             errorMessageTemplate = typeof(PersistentMapInheritanceAttribute).Name + " is required";
             return false;
         }
     }
     return true;
 }
Пример #4
0
 protected ForexTradeRule(string id, ContextIdentifiers targetContextIDs, Type targetType)
     : base(id, targetContextIDs, targetType)
 {
 }
 public RuleRequiredForAtLeast1Property(string id, ContextIdentifiers targetContextIDs, Type objectType)
     : base(id, targetContextIDs, objectType)
 {
 }
Пример #6
0
 public RuleRequiredForAtLeast1Property(string id, ContextIdentifiers targetContextIDs, Type objectType)
     : base(id, targetContextIDs, objectType)
 {
 }
Пример #7
0
 public RuleMessage(ContextIdentifiers targetContextIDs, Type targetType)
     : base("", targetContextIDs, targetType) {
 }
Пример #8
0
 public bool IsPropertyValueValid(string propertyName, ref string errorMessageTemplate, ContextIdentifiers contextIdentifiers,
                                  string ruleId)
 {
     if (propertyName == "OwnMembers" && contextIdentifiers == ContextIdentifier.Save)
     {
         var persistentReferenceMemberInfos = OwnMembers.OfType <PersistentReferenceMemberInfo>().Where(info => info.TypeAttributes.OfType <PersistentAssociationAttribute>().Any());
         foreach (var persistentReferenceMemberInfo in persistentReferenceMemberInfos)
         {
             var associationAttribute = persistentReferenceMemberInfo.TypeAttributes.OfType <PersistentAssociationAttribute>().FirstOrDefault();
             if (associationAttribute != null)
             {
                 var persistentCollectionMemberInfos = persistentReferenceMemberInfo.Owner.OwnMembers.OfType <PersistentCollectionMemberInfo>();
                 if (!persistentCollectionMemberInfos.Any(info => info.TypeAttributes.OfType <PersistentAssociationAttribute>()
                                                          .Any(attribute => attribute.AssociationName == associationAttribute.AssociationName)))
                 {
                     return(false);
                 }
             }
         }
     }
     return(true);
 }
Пример #9
0
 protected PivotGridSavedLayoutDeleteRule(string id, ContextIdentifiers targetContextIDs, Type targetType)
     : base(id, targetContextIDs, targetType)
 {
 }
Пример #10
0
 public RuleMessage(ContextIdentifiers targetContextIDs, Type targetType)
     : base("", targetContextIDs, targetType)
 {
 }
Пример #11
0
 public RuleMessage(ContextIdentifiers targetContextIDs, Type targetType, List <string> usedProperties = null)
     : base("", targetContextIDs, targetType)
 {
     usedProperties  = usedProperties ?? new List <string>();
     _usedProperties = usedProperties;
 }
Пример #12
0
        /// <summary>
        /// Retorna verdeiro se a Rule passada como parâmetro
        /// estiver válida.
        /// </summary>
        /// <param name="entity">Nome da Entidade</param>
        /// <param name="ruleID">ID da Regra</param>
        /// <param name="contextIDs">Identificação do contexto onde a validação será aplicada</param>
        /// <returns>Verdadeiro se a regra estiver válida</returns>
        public static ValidationState GetRuleStateID(BaseObject entity, string ruleID, ContextIdentifiers contextIDs)
        {
            RuleSetValidationResult rsvr = (new RuleSet()).ValidateTarget(entity, contextIDs);

            return(GetResultValidationItemID(rsvr.Results, ruleID).State);
        }
Пример #13
0
 protected PivotGridSavedLayoutSaveRule(string id, ContextIdentifiers targetContextIDs)
     : base(id, targetContextIDs)
 {
 }
 public RuleFromIPropertyValueValidator(string id, PropertyInfo property, ContextIdentifiers targetContextIDs)
     : base(id, property, targetContextIDs, property.DeclaringType)
 {
 }
Пример #15
0
 public RuleValidFileName(string id, IMemberInfo property, ContextIdentifiers targetContextIDs, Type objectType) : base(id, property, targetContextIDs, objectType)
 {
 }
Пример #16
0
 protected RuleCriteriaValidationBase(string id, ContextIdentifiers targetContextIDs, Type targetType) :
     base(id, targetContextIDs, targetType)
 {
 }
Пример #17
0
 protected GenLedgerRule(string id, ContextIdentifiers targetContextIDs, Type targetType)
     : base(id, targetContextIDs, targetType)
 {
 }