コード例 #1
0
 public Reference(DatabaseSession session, IClass objectType, long objectId, long version)
     : this(session, objectType, objectId, false)
 {
     this.version = version;
     this.flags[MaskExistsKnown] = true;
     this.flags[MaskExists]      = true;
 }
コード例 #2
0
        public Reference(DatabaseSession session, IClass objectType, long objectId, bool isNew)
        {
            this.session    = session;
            this.objectType = objectType;
            this.objectId   = objectId;

            this.flags[MaskIsNew] = isNew;
            if (isNew)
            {
                this.flags[MaskExistsKnown] = true;
                this.flags[MaskExists]      = true;
            }
        }
コード例 #3
0
        public IObject ExtentFirst(DatabaseSession session, IRoleType roleType)
        {
            CompositeRoles compositeRoles;

            if (this.ModifiedRolesByRoleType != null && this.ModifiedRolesByRoleType.TryGetValue(roleType, out compositeRoles))
            {
                var objectId = compositeRoles.First;
                return(objectId == null ? null : session.GetOrCreateAssociationForExistingObject(objectId.Value).Strategy.GetObject());
            }

            var nonModifiedCompositeRoles = this.GetNonModifiedCompositeRoles(roleType);

            if (nonModifiedCompositeRoles.Length > 0)
            {
                return(session.GetOrCreateAssociationForExistingObject(nonModifiedCompositeRoles[0]).Strategy.GetObject());
            }

            return(null);
        }
コード例 #4
0
        public void ExtentCopyTo(DatabaseSession session, IRoleType roleType, Array array, int index)
        {
            CompositeRoles compositeRoles;

            if (this.ModifiedRolesByRoleType != null && this.ModifiedRolesByRoleType.TryGetValue(roleType, out compositeRoles))
            {
                var i = 0;
                foreach (var objectId in compositeRoles.ObjectIds)
                {
                    array.SetValue(session.GetOrCreateAssociationForExistingObject(objectId).Strategy.GetObject(), index + i);
                    ++i;
                }

                return;
            }

            var nonModifiedCompositeRoles = this.GetNonModifiedCompositeRoles(roleType);

            for (var i = 0; i < nonModifiedCompositeRoles.Length; i++)
            {
                var objectId = nonModifiedCompositeRoles[i];
                array.SetValue(session.GetOrCreateAssociationForExistingObject(objectId).Strategy.GetObject(), index + i);
            }
        }
コード例 #5
0
ファイル: ExtentSort.cs プロジェクト: lulzzz/allors2
 public ExtentSort(DatabaseSession session, IRoleType roleType, SortDirection direction)
 {
     this.session   = session;
     this.roleType  = roleType;
     this.direction = direction;
 }
コード例 #6
0
 public ExtentFiltered(DatabaseSession session, IComposite objectType)
 {
     this.session    = session;
     this.objectType = objectType;
 }
コード例 #7
0
 public ExtentFiltered(DatabaseSession session, Strategy strategy, IAssociationType associationType)
     : this(session, associationType.ObjectType)
 {
     this.Strategy        = strategy;
     this.AssociationType = associationType;
 }
コード例 #8
0
 public ExtentFiltered(DatabaseSession session, Strategy strategy, IRoleType roleType)
     : this(session, (IComposite)roleType.ObjectType)
 {
     this.Strategy = strategy;
     this.RoleType = roleType;
 }