コード例 #1
0
 // TODO: AsReadOnly
 public ReplicationResult(ReplicaObjectCollection objects, bool hasMore, ReplicationCookie cookie, int totalObjectCount)
 {
     this.Objects          = objects;
     this.HasMoreData      = hasMore;
     this.Cookie           = cookie;
     this.TotalObjectCount = totalObjectCount;
 }
コード例 #2
0
 private static bool MemberwiseEquals(ReplicationCookie a, ReplicationCookie b)
 {
     return(a.HighObjUpdate == b.HighObjUpdate &&
            a.HighPropUpdate == b.HighPropUpdate &&
            a.InvocationId == b.InvocationId &&
            a.NamingContext == b.NamingContext &&
            a.Reserved == b.Reserved);
 }
コード例 #3
0
 /// <summary>
 /// Performs memberwise assignment.
 /// </summary>
 /// <param name="cookie">The cookie to assign.</param>
 public void Assign(ReplicationCookie cookie)
 {
     this.NamingContext  = cookie.NamingContext;
     this.InvocationId   = cookie.InvocationId;
     this.HighObjUpdate  = cookie.HighObjUpdate;
     this.Reserved       = cookie.Reserved;
     this.HighPropUpdate = cookie.HighPropUpdate;
 }
コード例 #4
0
        public bool Equals(ReplicationCookie cookie)
        {
            // If parameter is null return false:
            if ((object)cookie == null)
            {
                return(false);
            }

            // Return true if the properties match:
            return(MemberwiseEquals(this, cookie));
        }
コード例 #5
0
        public override bool Equals(object obj)
        {
            // If parameter is null return false.
            if (obj == null)
            {
                return(false);
            }

            // If parameter cannot be cast to ReplicationCookie return false.
            ReplicationCookie cookie = obj as ReplicationCookie;

            if ((object)cookie == null)
            {
                return(false);
            }

            // Return true if the properties match:
            return(MemberwiseEquals(this, cookie));
        }
コード例 #6
0
 public IEnumerable<DSAccount> GetAccounts(string domainNamingContext)
 {
     ReplicationResult result;
     // Set Schema
     // TODO: Test bad cookie
     ReplicationCookie cookie = new ReplicationCookie(domainNamingContext);
     var schema = BasicSchemaFactory.CreateSchema();
     do
     {
         result = this.drsConnection.ReplicateAllObjects(cookie);
         foreach (var obj in result.Objects)
         {
             obj.Schema = schema;
             if(!obj.IsAccount)
             {
                 continue;
             }
             var account = new DSAccount(obj, this.SecretDecryptor);
             yield return account;
         }
         cookie = result.Cookie;
     } while (result.HasMoreData);
 }
コード例 #7
0
 // TODO: AsReadOnly
 public ReplicationResult(ReplicaObjectCollection objects, bool hasMore, ReplicationCookie cookie)
 {
     this.Objects     = objects;
     this.HasMoreData = hasMore;
     this.Cookie      = cookie;
 }
コード例 #8
0
 // TODO: AsReadOnly
 public ReplicationResult(ReplicaObjectCollection objects, bool hasMore, ReplicationCookie cookie)
 {
     this.Objects = objects;
     this.HasMoreData = hasMore;
     this.Cookie = cookie;
 }