Example #1
0
        internal static FullSyncObjectRequest Parse(string requestBlob)
        {
            if (string.IsNullOrEmpty(requestBlob))
            {
                throw new ArgumentException("requestBlob");
            }
            FullSyncObjectRequest result;

            try
            {
                string[] array = requestBlob.Split(new string[]
                {
                    "#"
                }, StringSplitOptions.None);
                if (array.Length != 6)
                {
                    throw new FormatException("requestBlob");
                }
                string       serviceInstanceId       = array[1];
                SyncObjectId identity                = SyncObjectId.Parse(array[2]);
                FullSyncObjectRequestOptions options = (FullSyncObjectRequestOptions)int.Parse(array[3]);
                ExDateTime creationTime              = ExDateTime.FromFileTimeUtc(long.Parse(array[4]));
                FullSyncObjectRequestState state     = (FullSyncObjectRequestState)int.Parse(array[5]);
                result = new FullSyncObjectRequest(identity, serviceInstanceId, options, creationTime, state);
            }
            catch (ArgumentException innerException)
            {
                throw new FormatException("requestBlob", innerException);
            }
            catch (FormatException innerException2)
            {
                throw new FormatException("requestBlob", innerException2);
            }
            catch (OverflowException innerException3)
            {
                throw new FormatException("requestBlob", innerException3);
            }
            return(result);
        }
Example #2
0
 internal bool Equals(FullSyncObjectRequest request)
 {
     return(!object.ReferenceEquals(null, request) && (object.ReferenceEquals(this, request) || (this.CreationTime == request.CreationTime && this.Identity.Equals(request.Identity) && this.Options == request.Options && this.ServiceInstanceId == request.ServiceInstanceId && this.State == request.State)));
 }