示例#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);
        }
示例#2
0
 public FullSyncObjectRequest(SyncObjectId identity, string serviceInstanceId, FullSyncObjectRequestOptions options, ExDateTime creationTime, FullSyncObjectRequestState state) : this()
 {
     if (identity == null)
     {
         throw new ArgumentNullException("identity");
     }
     if (serviceInstanceId == null)
     {
         throw new ArgumentNullException("serviceInstanceId");
     }
     this.SetIdentity(identity);
     this.ServiceInstanceId = serviceInstanceId;
     this.Options           = options;
     this.CreationTime      = creationTime;
     this.State             = state;
 }