Exemple #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;
 }
 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);
 }
 /// <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;
 }
        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));
        }
        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));
        }
 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);
 }
 // TODO: AsReadOnly
 public ReplicationResult(ReplicaObjectCollection objects, bool hasMore, ReplicationCookie cookie)
 {
     this.Objects     = objects;
     this.HasMoreData = hasMore;
     this.Cookie      = cookie;
 }
 // TODO: AsReadOnly
 public ReplicationResult(ReplicaObjectCollection objects, bool hasMore, ReplicationCookie cookie)
 {
     this.Objects = objects;
     this.HasMoreData = hasMore;
     this.Cookie = cookie;
 }