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