Beispiel #1
0
        public static ADReplicationCursorCollection Parse(byte[] binary)
        {
            if (binary == null)
            {
                throw new ArgumentNullException("binary");
            }
            ADReplicationCursorCollection adreplicationCursorCollection = new ADReplicationCursorCollection();
            Exception innerException = null;

            try
            {
                using (MemoryStream memoryStream = new MemoryStream(binary))
                {
                    using (BinaryReader binaryReader = new BinaryReader(memoryStream))
                    {
                        int num = binaryReader.ReadInt32();
                        if (num == 1)
                        {
                            binaryReader.ReadInt32();
                            int num2 = binaryReader.ReadInt32();
                            binaryReader.ReadInt32();
                            while (num2-- > 0)
                            {
                                Guid sourceInvocationId = new Guid(binaryReader.ReadBytes(16));
                                long upToDatenessUsn    = binaryReader.ReadInt64();
                                adreplicationCursorCollection.Add(new ReplicationCursor(sourceInvocationId, upToDatenessUsn, DateTime.MinValue, null));
                            }
                            return(adreplicationCursorCollection);
                        }
                    }
                }
            }
            catch (ArgumentException ex)
            {
                innerException = ex;
            }
            catch (IOException ex2)
            {
                innerException = ex2;
            }
            throw new FormatException("Unrecognized format.", innerException);
        }
Beispiel #2
0
        // Token: 0x0600121B RID: 4635 RVA: 0x00057BA4 File Offset: 0x00055DA4
        public static ADDirSyncCookie Parse(byte[] binaryCookie)
        {
            if (binaryCookie == null)
            {
                throw new ArgumentNullException("binaryCookie");
            }
            Exception innerException = null;

            try
            {
                using (MemoryStream memoryStream = new MemoryStream(binaryCookie))
                {
                    using (BinaryReader binaryReader = new BinaryReader(memoryStream))
                    {
                        byte[] first = binaryReader.ReadBytes(4);
                        if (first.SequenceEqual(ADDirSyncCookie.Header) && binaryReader.ReadInt32() == 3)
                        {
                            binaryReader.ReadInt64();
                            binaryReader.ReadInt64();
                            int  num  = binaryReader.ReadInt32();
                            long num2 = binaryReader.ReadInt64();
                            binaryReader.ReadInt64();
                            long   num3   = binaryReader.ReadInt64();
                            Guid   guid   = new Guid(binaryReader.ReadBytes(16));
                            byte[] binary = binaryReader.ReadBytes(num);
                            ADReplicationCursorCollection adreplicationCursorCollection = (num == 0) ? new ADReplicationCursorCollection() : ADReplicationCursorCollection.Parse(binary);
                            return(new ADDirSyncCookie(guid, num2, num3, adreplicationCursorCollection));
                        }
                    }
                }
            }
            catch (ArgumentException ex)
            {
                innerException = ex;
            }
            catch (IOException ex2)
            {
                innerException = ex2;
            }
            throw new FormatException("Unrecognized cookie format.", innerException);
        }
Beispiel #3
0
 // Token: 0x06001215 RID: 4629 RVA: 0x00057B3D File Offset: 0x00055D3D
 internal ADDirSyncCookie(Guid invocationId, long objectUpdateSequenceNumber, long propertyUpdateSequenceNumber, ADReplicationCursorCollection cursors)
 {
     if (cursors == null)
     {
         throw new ArgumentNullException("cursors");
     }
     this.invocationId = invocationId;
     this.objectUpdateSequenceNumber   = objectUpdateSequenceNumber;
     this.propertyUpdateSequenceNumber = propertyUpdateSequenceNumber;
     this.cursors = cursors;
 }