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

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

            this.roleType             = roleType;
            this.containingEnumerable = containingEnumerable;
        }
Ejemplo n.º 3
0
        internal RoleInstanceof(ExtentFiltered extent, IRoleType roleType, IComposite objectType)
        {
            extent.CheckForRoleType(roleType);
            PredicateAssertions.ValidateRoleInstanceOf(roleType, objectType);

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

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

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

            this.roleType        = roleType;
            this.containedObject = containedObject;
        }
Ejemplo n.º 7
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("%", ".*") + "$");
        }
Ejemplo n.º 8
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;
        }
Ejemplo n.º 9
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;
        }
Ejemplo n.º 10
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.");
                }
            }