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)); }
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); }
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; }
protected ForexTradeRule(string id, ContextIdentifiers targetContextIDs, Type targetType) : base(id, targetContextIDs, targetType) { }
public RuleRequiredForAtLeast1Property(string id, ContextIdentifiers targetContextIDs, Type objectType) : base(id, targetContextIDs, objectType) { }
public RuleMessage(ContextIdentifiers targetContextIDs, Type targetType) : base("", targetContextIDs, targetType) { }
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); }
protected PivotGridSavedLayoutDeleteRule(string id, ContextIdentifiers targetContextIDs, Type targetType) : base(id, targetContextIDs, targetType) { }
public RuleMessage(ContextIdentifiers targetContextIDs, Type targetType, List <string> usedProperties = null) : base("", targetContextIDs, targetType) { usedProperties = usedProperties ?? new List <string>(); _usedProperties = usedProperties; }
/// <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); }
protected PivotGridSavedLayoutSaveRule(string id, ContextIdentifiers targetContextIDs) : base(id, targetContextIDs) { }
public RuleFromIPropertyValueValidator(string id, PropertyInfo property, ContextIdentifiers targetContextIDs) : base(id, property, targetContextIDs, property.DeclaringType) { }
public RuleValidFileName(string id, IMemberInfo property, ContextIdentifiers targetContextIDs, Type objectType) : base(id, property, targetContextIDs, objectType) { }
protected RuleCriteriaValidationBase(string id, ContextIdentifiers targetContextIDs, Type targetType) : base(id, targetContextIDs, targetType) { }
protected GenLedgerRule(string id, ContextIdentifiers targetContextIDs, Type targetType) : base(id, targetContextIDs, targetType) { }