Esempio n. 1
0
        internal RoleExists(ExtentFiltered extent, IRoleType roleType)
        {
            extent.CheckForRoleType(roleType);
            PredicateAssertions.ValidateRoleExists(roleType);

            this.roleType = roleType;
        }
        internal AssociationExists(ExtentFiltered extent, IAssociationType associationType)
        {
            extent.CheckForAssociationType(associationType);
            PredicateAssertions.ValidateAssociationExists(associationType);

            this.associationType = associationType;
        }
        internal AssociationInstanceOf(ExtentFiltered extent, IAssociationType associationType, IObjectType instanceObjectType)
        {
            extent.CheckForAssociationType(associationType);
            PredicateAssertions.ValidateAssociationInstanceof(associationType, instanceObjectType);

            this.associationType = associationType;
            this.objectType      = instanceObjectType;
        }
Esempio n. 4
0
        internal AssociationContainedInEnumerable(ExtentFiltered extent, IAssociationType associationType, IEnumerable <IObject> containingEnumerable)
        {
            extent.CheckForAssociationType(associationType);
            PredicateAssertions.AssertAssociationContainedIn(associationType, containingEnumerable);

            this.associationType      = associationType;
            this.containingEnumerable = containingEnumerable;
        }
        internal RoleManyContainedInEnumerable(ExtentFiltered extent, IRoleType roleType, IEnumerable <IObject> containingEnumerable)
        {
            extent.CheckForRoleType(roleType);
            PredicateAssertions.ValidateRoleContainedIn(roleType, containingEnumerable);

            this.roleType             = roleType;
            this.containingEnumerable = containingEnumerable;
        }
Esempio n. 6
0
        internal RoleContains(ExtentFiltered extent, IRoleType roleType, IObject containedObject)
        {
            extent.CheckForRoleType(roleType);
            PredicateAssertions.ValidateRoleContains(roleType, containedObject);

            this.roleType        = roleType;
            this.containedObject = containedObject;
        }
        internal RoleOneContainedInExtent(ExtentFiltered extent, IRoleType roleType, Allors.Extent containingExtent)
        {
            extent.CheckForRoleType(roleType);
            PredicateAssertions.ValidateRoleContainedIn(roleType, containingExtent);

            this.roleType         = roleType;
            this.containingExtent = containingExtent;
        }
Esempio n. 8
0
        internal RoleInstanceof(ExtentFiltered extent, IRoleType roleType, IComposite objectType)
        {
            extent.CheckForRoleType(roleType);
            PredicateAssertions.ValidateRoleInstanceOf(roleType, objectType);

            this.roleType   = roleType;
            this.objectType = objectType;
        }
        internal AssociationEquals(ExtentFiltered extent, IAssociationType associationType, IObject equals)
        {
            extent.CheckForAssociationType(associationType);
            PredicateAssertions.AssertAssociationEquals(associationType, equals);

            this.associationType = associationType;
            this.equals          = equals;
        }
Esempio n. 10
0
        internal AssociationContainedInExtent(ExtentFiltered extent, IAssociationType associationType, Allors.Extent containingExtent)
        {
            extent.CheckForAssociationType(associationType);
            PredicateAssertions.AssertAssociationContainedIn(associationType, containingExtent);

            this.associationType  = associationType;
            this.containingExtent = containingExtent;
        }
        internal AssociationContains(ExtentFiltered extent, IAssociationType associationType, IObject containedObject)
        {
            extent.CheckForAssociationType(associationType);
            PredicateAssertions.AssertAssociationContains(associationType, containedObject);

            this.associationType = associationType;
            this.containedObject = containedObject;
        }
        internal RoleCompositeEqualsValue(ExtentFiltered extent, IRoleType roleType, object equals)
        {
            extent.CheckForRoleType(roleType);
            PredicateAssertions.ValidateRoleEquals(roleType, equals);

            this.roleType = roleType;
            this.equals   = equals;
        }
Esempio n. 13
0
        internal RoleLike(ExtentFiltered extent, IRoleType roleType, string like)
        {
            extent.CheckForRoleType(roleType);
            PredicateAssertions.ValidateRoleLikeFilter(roleType, like);

            this.roleType = roleType;
            this.isEmpty  = like.Length == 0;
            this.regex    = new Regex("^" + like.Replace("%", ".*") + "$");
        }
Esempio n. 14
0
        internal RoleLessThan(ExtentFiltered extent, IRoleType roleType, object compare)
        {
            extent.CheckForRoleType(roleType);
            PredicateAssertions.ValidateRoleLessThan(roleType, compare);

            this.extent   = extent;
            this.roleType = roleType;
            this.compare  = compare;
        }
 internal override void UpgradeTo(ExtentFiltered extent)
 {
     if (this.associationType.RoleType.IsMany)
     {
         extent.Filter.AddContains(this.associationType.RoleType, this.roleStrategy.GetObject());
     }
     else
     {
         extent.Filter.AddEquals(this.associationType.RoleType, this.roleStrategy.GetObject());
     }
 }
Esempio n. 16
0
        internal RoleBetween(ExtentFiltered extent, IRoleType roleType, object first, object second)
        {
            extent.CheckForRoleType(roleType);
            PredicateAssertions.ValidateRoleBetween(roleType, first, second);

            this.extent   = extent;
            this.roleType = roleType;

            this.first  = first;
            this.second = second;
        }
Esempio n. 17
0
        internal RoleUnitEquals(ExtentFiltered extent, IRoleType roleType, object equals)
        {
            extent.CheckForRoleType(roleType);
            PredicateAssertions.ValidateRoleEquals(roleType, equals);

            this.extent   = extent;
            this.roleType = roleType;
            if (equals is Enum)
            {
                if (roleType.ObjectType is IUnit unitType && unitType.IsInteger)
                {
                    this.equals = (int)equals;
                }
                else
                {
                    throw new Exception("Role Object Type " + roleType.ObjectType.SingularName + " doesn't support enumerations.");
                }
            }
Esempio n. 18
0
 internal Not(ExtentFiltered extent) => this.extent = extent;
Esempio n. 19
0
 internal CompositePredicate(ExtentFiltered extent)
 {
     this.extent  = extent;
     this.Filters = new List <Predicate>(4);
 }