示例#1
0
 internal RoleEqualsRole(ExtentFiltered extent, IRoleType role, IRoleType equalsRole)
 {
     extent.CheckRole(role);
     PredicateAssertions.ValidateRoleEquals(role, equalsRole);
     this.role = role;
     this.equalsRole = equalsRole;
 }
示例#2
0
 internal RoleGreaterThanRole(ExtentFiltered extent, IRoleType role, IRoleType greaterThanRole)
 {
     extent.CheckRole(role);
     PredicateAssertions.ValidateRoleGreaterThan(role, greaterThanRole);
     this.role = role;
     this.greaterThanRole = greaterThanRole;
 }
示例#3
0
 internal RoleInstanceof(ExtentFiltered extent, IRoleType role, IObjectType instanceType, IObjectType[] instanceClasses)
 {
     extent.CheckRole(role);
     PredicateAssertions.ValidateRoleInstanceOf(role, instanceType);
     this.role = role;
     this.instanceClasses = instanceClasses;
 }
 internal AssociationContainedInEnumerable(ExtentFiltered extent, IAssociationType association, IEnumerable<IObject> enumerable)
 {
     extent.CheckAssociation(association);
     PredicateAssertions.AssertAssociationContainedIn(association, this.enumerable);
     this.association = association;
     this.enumerable = enumerable;
 }
示例#5
0
 internal RoleContainedInExtent(ExtentFiltered extent, IRoleType role, Allors.Extent inExtent)
 {
     extent.CheckRole(role);
     PredicateAssertions.ValidateRoleContainedIn(role, inExtent);
     this.role = role;
     this.inExtent = ((Extent)inExtent).ContainedInExtent;
 }
示例#6
0
 internal AssociationInstanceOf(ExtentFiltered extent, IAssociationType association, IObjectType instanceType, IObjectType[] instanceClasses)
 {
     extent.CheckAssociation(association);
     PredicateAssertions.ValidateAssociationInstanceof(association, instanceType);
     this.association     = association;
     this.instanceClasses = instanceClasses;
 }
示例#7
0
 internal RoleContainedInEnumerable(ExtentFiltered extent, IRoleType role, IEnumerable <IObject> enumerable)
 {
     extent.CheckRole(role);
     PredicateAssertions.ValidateRoleContainedIn(role, enumerable);
     this.role       = role;
     this.enumerable = enumerable;
 }
 internal RoleContainedInEnumerable(ExtentFiltered extent, IRoleType role, IEnumerable<IObject> enumerable)
 {
     extent.CheckRole(role);
     PredicateAssertions.ValidateRoleContainedIn(role, this.enumerable);
     this.role = role;
     this.enumerable = enumerable;
 }
示例#9
0
        internal Not(ExtentFiltered extent)
        {
            this.extent = extent;

            if (extent.Strategy != null)
            {
                var allorsObject = extent.Strategy.GetObject();
                if (extent.AssociationType != null)
                {
                    var role = extent.AssociationType.RoleType;
                    if (role.IsMany)
                    {
                        this.AddContains(role, allorsObject);
                    }
                    else
                    {
                        this.AddEquals(role, allorsObject);
                    }
                }
                else
                {
                    var association = extent.RoleType.AssociationType;
                    if (association.IsMany)
                    {
                        this.AddContains(association, allorsObject);
                    }
                    else
                    {
                        this.AddEquals(association, allorsObject);
                    }
                }
            }
        }
 internal RoleEqualsRole(ExtentFiltered extent, IRoleType role, IRoleType equalsRole)
 {
     extent.CheckRole(role);
     PredicateAssertions.ValidateRoleEquals(role, equalsRole);
     this.role       = role;
     this.equalsRole = equalsRole;
 }
示例#11
0
 internal RoleLessThanValue(ExtentFiltered extent, IRoleType roleType, object obj)
 {
     extent.CheckRole(roleType);
     PredicateAssertions.ValidateRoleLessThan(roleType, obj);
     this.roleType = roleType;
     this.obj = roleType.Normalize(obj);
 }
 internal AssociationContainedInExtent(ExtentFiltered extent, IAssociationType association, Allors.Extent inExtent)
 {
     extent.CheckAssociation(association);
     PredicateAssertions.AssertAssociationContainedIn(association, inExtent);
     this.association = association;
     this.inExtent = ((Extent)inExtent).ContainedInExtent;
 }
示例#13
0
        protected CompositePredicate(ExtentFiltered extent)
        {
            this.extent = extent;
            this.filters = new List<Predicate>(4);

            if (extent.Strategy != null)
            {
                var allorsObject = extent.Strategy.GetObject();
                if (extent.AssociationType != null)
                {
                    var role = extent.AssociationType.RoleType;
                    if (role.IsMany)
                    {
                        this.AddContains(role, allorsObject);
                    }
                    else
                    {
                        this.AddEquals(role, allorsObject);
                    }
                }
                else
                {
                    var association = extent.RoleType.AssociationType;
                    if (association.IsMany)
                    {
                        this.AddContains(association, allorsObject);
                    }
                    else
                    {
                        this.AddEquals(association, allorsObject);
                    }
                }
            }
        }
 internal RoleLessThanRole(ExtentFiltered extent, IRoleType role, IRoleType lessThanRole)
 {
     extent.CheckRole(role);
     PredicateAssertions.ValidateRoleLessThan(role, lessThanRole);
     this.role         = role;
     this.lessThanRole = lessThanRole;
 }
示例#15
0
 private void LazyUpgrade()
 {
     if (this.upgrade == null)
     {
         this.upgrade = new ExtentFiltered(this.strategy.Session, this.strategy, this.associationType);
     }
 }
示例#16
0
 internal AssociationInstanceOf(ExtentFiltered extent, IAssociationType association, IObjectType instanceType, IObjectType[] instanceClasses)
 {
     extent.CheckAssociation(association);
     PredicateAssertions.ValidateAssociationInstanceof(association, instanceType);
     this.association = association;
     this.instanceClasses = instanceClasses;
 }
示例#17
0
 internal AssociationEquals(ExtentFiltered extent, IAssociationType association, IObject allorsObject)
 {
     extent.CheckAssociation(association);
     PredicateAssertions.AssertAssociationEquals(association, allorsObject);
     this.association = association;
     this.allorsObject = allorsObject;
 }
示例#18
0
文件: Not.cs 项目: whesius/allors
        internal Not(ExtentFiltered extent)
        {
            this.extent = extent;

            if (extent.Strategy != null)
            {
                var allorsObject = extent.Strategy.GetObject();
                if (extent.AssociationType != null)
                {
                    var role = extent.AssociationType.RoleType;
                    if (role.IsMany)
                    {
                        this.AddContains(role, allorsObject);
                    }
                    else
                    {
                        this.AddEquals(role, allorsObject);
                    }
                }
                else
                {
                    var association = extent.RoleType.AssociationType;
                    if (association.IsMany)
                    {
                        this.AddContains(association, allorsObject);
                    }
                    else
                    {
                        this.AddEquals(association, allorsObject);
                    }
                }
            }
        }
示例#19
0
 internal RoleLessThanValue(ExtentFiltered extent, IRoleType roleType, object obj)
 {
     extent.CheckRole(roleType);
     PredicateAssertions.ValidateRoleLessThan(roleType, obj);
     this.roleType = roleType;
     this.obj      = roleType.Normalize(obj);
 }
示例#20
0
 internal RoleContains(ExtentFiltered extent, IRoleType role, IObject allorsObject)
 {
     extent.CheckRole(role);
     PredicateAssertions.ValidateRoleContains(role, allorsObject);
     this.role         = role;
     this.allorsObject = allorsObject;
 }
示例#21
0
 internal RoleContains(ExtentFiltered extent, IRoleType role, IObject allorsObject)
 {
     extent.CheckRole(role);
     PredicateAssertions.ValidateRoleContains(role, allorsObject);
     this.role = role;
     this.allorsObject = allorsObject;
 }
 internal AssociationContainedInExtent(ExtentFiltered extent, IAssociationType association, Allors.Extent inExtent)
 {
     extent.CheckAssociation(association);
     PredicateAssertions.AssertAssociationContainedIn(association, inExtent);
     this.association = association;
     this.inExtent    = ((Extent)inExtent).ContainedInExtent;
 }
 internal RoleInstanceof(ExtentFiltered extent, IRoleType role, IObjectType instanceType, IObjectType[] instanceClasses)
 {
     extent.CheckRole(role);
     PredicateAssertions.ValidateRoleInstanceOf(role, instanceType);
     this.role            = role;
     this.instanceClasses = instanceClasses;
 }
示例#24
0
 internal RoleContainedInExtent(ExtentFiltered extent, IRoleType role, Allors.Extent inExtent)
 {
     extent.CheckRole(role);
     PredicateAssertions.ValidateRoleContainedIn(role, inExtent);
     this.role     = role;
     this.inExtent = ((Extent)inExtent).ContainedInExtent;
 }
示例#25
0
 internal RoleLike(ExtentFiltered extent, IRoleType role, string like)
 {
     extent.CheckRole(role);
     PredicateAssertions.ValidateRoleLikeFilter(role, like);
     this.role = role;
     this.like = like;
 }
示例#26
0
 internal RoleLike(ExtentFiltered extent, IRoleType role, string like)
 {
     extent.CheckRole(role);
     PredicateAssertions.ValidateRoleLikeFilter(role, like);
     this.role = role;
     this.like = like;
 }
示例#27
0
 internal AssociationContains(ExtentFiltered extent, IAssociationType association, IObject allorsObject)
 {
     extent.CheckAssociation(association);
     PredicateAssertions.AssertAssociationContains(association, allorsObject);
     this.association  = association;
     this.allorsObject = allorsObject;
 }
示例#28
0
        protected CompositePredicate(ExtentFiltered extent)
        {
            this.extent  = extent;
            this.filters = new List <Predicate>(4);

            if (extent.Strategy != null)
            {
                var allorsObject = extent.Strategy.GetObject();
                if (extent.AssociationType != null)
                {
                    var role = extent.AssociationType.RoleType;
                    if (role.IsMany)
                    {
                        this.AddContains(role, allorsObject);
                    }
                    else
                    {
                        this.AddEquals(role, allorsObject);
                    }
                }
                else
                {
                    var association = extent.RoleType.AssociationType;
                    if (association.IsMany)
                    {
                        this.AddContains(association, allorsObject);
                    }
                    else
                    {
                        this.AddEquals(association, allorsObject);
                    }
                }
            }
        }
示例#29
0
 internal RoleLessThanRole(ExtentFiltered extent, IRoleType role, IRoleType lessThanRole)
 {
     extent.CheckRole(role);
     PredicateAssertions.ValidateRoleLessThan(role, lessThanRole);
     this.role = role;
     this.lessThanRole = lessThanRole;
 }
 internal AssociationContainedInEnumerable(ExtentFiltered extent, IAssociationType association, IEnumerable <IObject> enumerable)
 {
     extent.CheckAssociation(association);
     PredicateAssertions.AssertAssociationContainedIn(association, this.enumerable);
     this.association = association;
     this.enumerable  = enumerable;
 }
示例#31
0
 internal RoleGreaterThanRole(ExtentFiltered extent, IRoleType role, IRoleType greaterThanRole)
 {
     extent.CheckRole(role);
     PredicateAssertions.ValidateRoleGreaterThan(role, greaterThanRole);
     this.role            = role;
     this.greaterThanRole = greaterThanRole;
 }
示例#32
0
 internal RoleBetweenValue(ExtentFiltered extent, IRoleType roleType, object first, object second)
 {
     extent.CheckRole(roleType);
     PredicateAssertions.ValidateRoleBetween(roleType, first, second);
     this.roleType = roleType;
     this.first = roleType.Normalize(first);
     this.second = roleType.Normalize(second);
 }
示例#33
0
 internal RoleBetweenValue(ExtentFiltered extent, IRoleType roleType, object first, object second)
 {
     extent.CheckRole(roleType);
     PredicateAssertions.ValidateRoleBetween(roleType, first, second);
     this.roleType = roleType;
     this.first    = roleType.Normalize(first);
     this.second   = roleType.Normalize(second);
 }
示例#34
0
 internal RoleBetweenRole(ExtentFiltered extent, IRoleType role, IRoleType first, IRoleType second)
 {
     extent.CheckRole(role);
     PredicateAssertions.ValidateRoleBetween(role, first, second);
     this.role   = role;
     this.first  = first;
     this.second = second;
 }
示例#35
0
 internal RoleBetweenRole(ExtentFiltered extent, IRoleType role, IRoleType first, IRoleType second)
 {
     extent.CheckRole(role);
     PredicateAssertions.ValidateRoleBetween(role, first, second);
     this.role = role;
     this.first = first;
     this.second = second;
 }
 internal RoleEqualsValue(ExtentFiltered extent, IRoleType roleType, object obj)
 {
     extent.CheckRole(roleType);
     PredicateAssertions.ValidateRoleEquals(roleType, obj);
     this.roleType = roleType;
     if (obj is Enum)
     {
         if (((IUnit)roleType.ObjectType).IsInteger)
         {
             this.obj = obj;
         }
         else
         {
             throw new Exception("Role Object Type " + roleType.ObjectType.Name + " doesn't support enumerations.");
         }
     }
     else
     {
         this.obj = roleType.ObjectType.IsUnit ? roleType.Normalize(obj) : obj;
     }
 }
示例#37
0
 internal RoleEqualsValue(ExtentFiltered extent, IRoleType roleType, object obj)
 {
     extent.CheckRole(roleType);
     PredicateAssertions.ValidateRoleEquals(roleType, obj);
     this.roleType = roleType;
     if (obj is Enum)
     {
         if (((IUnit)roleType.ObjectType).IsInteger)
         {
             this.obj = (int)obj;
         }
         else
         {
             throw new Exception("Role Object Type " + roleType.ObjectType.Name + " doesn't support enumerations.");
         }
     }
     else
     {
         this.obj = roleType.ObjectType.IsUnit ? roleType.Normalize(obj) : obj;
     }
 }
示例#38
0
 internal AssociationExists(ExtentFiltered extent, IAssociationType association)
 {
     extent.CheckAssociation(association);
     PredicateAssertions.ValidateAssociationExists(association);
     this.association = association;
 }
示例#39
0
 internal RoleExists(ExtentFiltered extent, IRoleType role)
 {
     extent.CheckRole(role);
     PredicateAssertions.ValidateRoleExists(role);
     this.role = role;
 }
示例#40
0
 private void LazyUpgrade()
 {
     if (this.upgrade == null)
     {
         this.upgrade = new ExtentFiltered(this.strategy.Session, this.strategy, this.associationType);
     }
 }
示例#41
0
 internal RoleExists(ExtentFiltered extent, IRoleType role)
 {
     extent.CheckRole(role);
     PredicateAssertions.ValidateRoleExists(role);
     this.role = role;
 }
示例#42
0
 internal AssociationExists(ExtentFiltered extent, IAssociationType association)
 {
     extent.CheckAssociation(association);
     PredicateAssertions.ValidateAssociationExists(association);
     this.association = association;
 }