Пример #1
0
 public byte[] ToByteArray()
 {
     byte[] result = null;
     using (BackSyncCookieWriter backSyncCookieWriter = BackSyncCookieWriter.Create(typeof(ObjectFullSyncPageToken)))
     {
         backSyncCookieWriter.WriteNextAttributeValue(this.Version);
         backSyncCookieWriter.WriteNextAttributeValue(this.ServiceInstanceId.InstanceId);
         backSyncCookieWriter.WriteNextAttributeValue(this.Timestamp.ToBinary());
         backSyncCookieWriter.WriteNextAttributeValue(this.LastReadFailureStartTime.ToBinary());
         backSyncCookieWriter.WriteNextAttributeValue(this.InvocationId);
         backSyncCookieWriter.WriteNextAttributeValue((int)this.SyncOptions);
         List <string> list = new List <string>();
         foreach (SyncObjectId syncObjectId in this.ObjectIds)
         {
             list.Add(syncObjectId.ToString());
         }
         backSyncCookieWriter.WriteNextAttributeValue(list.ToArray());
         if (this.ObjectCookie != null)
         {
             backSyncCookieWriter.WriteNextAttributeValue(this.ObjectCookie.ToByteArray());
         }
         else
         {
             backSyncCookieWriter.WriteNextAttributeValue(null);
         }
         string[] attributeValue = BackSyncCookie.ConvertErrorObjectsAndFailureCountsToArray(this.ErrorObjectsAndFailureCounts);
         backSyncCookieWriter.WriteNextAttributeValue(attributeValue);
         backSyncCookieWriter.WriteNextAttributeValue(this.SequenceStartTimestamp.ToBinary());
         backSyncCookieWriter.WriteNextAttributeValue(this.SequenceId);
         result = backSyncCookieWriter.GetBinaryCookie();
     }
     return(result);
 }
 public virtual byte[] ToByteArray()
 {
     byte[] result = null;
     using (BackSyncCookieWriter backSyncCookieWriter = BackSyncCookieWriter.Create(typeof(TenantFullSyncPageToken)))
     {
         backSyncCookieWriter.WriteNextAttributeValue(this.Version);
         backSyncCookieWriter.WriteNextAttributeValue(this.ServiceInstanceId.InstanceId);
         backSyncCookieWriter.WriteNextAttributeValue(this.Timestamp.ToBinary());
         backSyncCookieWriter.WriteNextAttributeValue(this.LastReadFailureStartTime.ToBinary());
         backSyncCookieWriter.WriteNextAttributeValue(this.InvocationId);
         backSyncCookieWriter.WriteNextAttributeValue(this.TenantExternalDirectoryId);
         backSyncCookieWriter.WriteNextAttributeValue(this.TenantObjectGuid);
         backSyncCookieWriter.WriteNextAttributeValue((int)this.State);
         backSyncCookieWriter.WriteNextAttributeValue(this.ObjectUpdateSequenceNumber);
         backSyncCookieWriter.WriteNextAttributeValue(this.TombstoneUpdateSequenceNumber);
         if (this.PendingWatermarks == null)
         {
             backSyncCookieWriter.WriteNextAttributeValue(null);
         }
         else
         {
             byte[] attributeValue = this.PendingWatermarks.SerializeToBytes();
             backSyncCookieWriter.WriteNextAttributeValue(attributeValue);
         }
         backSyncCookieWriter.WriteNextAttributeValue(this.PendingWatermarksInvocationId);
         if (this.Watermarks == null)
         {
             backSyncCookieWriter.WriteNextAttributeValue(null);
         }
         else
         {
             byte[] attributeValue2 = this.Watermarks.SerializeToBytes();
             backSyncCookieWriter.WriteNextAttributeValue(attributeValue2);
         }
         backSyncCookieWriter.WriteNextAttributeValue(this.WatermarksInvocationId);
         backSyncCookieWriter.WriteNextAttributeValue(this.LinkPageStart);
         backSyncCookieWriter.WriteNextAttributeValue(this.LinkPageEnd);
         backSyncCookieWriter.WriteNextAttributeValue(this.LinkRangeStart);
         backSyncCookieWriter.WriteNextAttributeValue(this.ObjectsInLinkPage);
         string[] attributeValue3 = BackSyncCookie.ConvertErrorObjectsAndFailureCountsToArray(this.ErrorObjectsAndFailureCounts);
         backSyncCookieWriter.WriteNextAttributeValue(attributeValue3);
         backSyncCookieWriter.WriteNextAttributeValue(this.SequenceStartTimestamp.ToBinary());
         backSyncCookieWriter.WriteNextAttributeValue(this.SequenceId);
         if (this.TenantScopedBackSyncCookie == null)
         {
             backSyncCookieWriter.WriteNextAttributeValue(null);
         }
         else
         {
             byte[] attributeValue4 = this.TenantScopedBackSyncCookie.ToByteArray();
             backSyncCookieWriter.WriteNextAttributeValue(attributeValue4);
         }
         backSyncCookieWriter.WriteNextAttributeValue(this.UseContainerizedUsnChangedIndex);
         backSyncCookieWriter.WriteNextAttributeValue(this.SoftDeletedObjectUpdateSequenceNumber);
         backSyncCookieWriter.WriteNextAttributeValue((int)this.PreviousState);
         result = backSyncCookieWriter.GetBinaryCookie();
     }
     return(result);
 }
 // Token: 0x060061E3 RID: 25059 RVA: 0x0014E900 File Offset: 0x0014CB00
 public byte[] ToByteArray()
 {
     ExTraceGlobals.BackSyncTracer.TraceDebug((long)SyncConfiguration.TraceId, "BackSyncCookie.ToByteArray entering");
     byte[] result = null;
     using (BackSyncCookieWriter backSyncCookieWriter = BackSyncCookieWriter.Create(typeof(BackSyncCookie)))
     {
         backSyncCookieWriter.WriteNextAttributeValue(this.Version);
         backSyncCookieWriter.WriteNextAttributeValue(this.ServiceInstanceId.InstanceId);
         backSyncCookieWriter.WriteNextAttributeValue(this.Timestamp.ToBinary());
         backSyncCookieWriter.WriteNextAttributeValue(this.LastReadFailureStartTime.ToBinary());
         backSyncCookieWriter.WriteNextAttributeValue(this.InvocationId);
         backSyncCookieWriter.WriteNextAttributeValue(this.MoreDirSyncData);
         backSyncCookieWriter.WriteNextAttributeValue(this.DirSyncCookie);
         string[] attributeValue = BackSyncCookie.ConvertErrorObjectsAndFailureCountsToArray(this.ErrorObjectsAndFailureCounts);
         backSyncCookieWriter.WriteNextAttributeValue(attributeValue);
         backSyncCookieWriter.WriteNextAttributeValue(this.LastWhenChanged.ToBinary());
         backSyncCookieWriter.WriteNextAttributeValue(this.LastDirSyncCookieWithReplicationVectors);
         backSyncCookieWriter.WriteNextAttributeValue(this.SequenceStartTimestamp.ToBinary());
         backSyncCookieWriter.WriteNextAttributeValue(this.SequenceId);
         result = backSyncCookieWriter.GetBinaryCookie();
     }
     return(result);
 }