internal static void SetRequestOptions(ref SerializableRequestOptions serializer, IRequestOptions requestOptions)
        {
            if (null == serializer && null == requestOptions)
            {
                return;
            }

            if (null == serializer)
            {
                serializer = CreateSerializableRequestOptions(requestOptions);
            }
            else
            {
                if ((requestOptions is FileRequestOptions)
                    && (serializer is SerializableBlobRequestOptions))
                {
                    serializer = new SerializableFileRequestOptions();
                }
                else if ((requestOptions is BlobRequestOptions)
                    && (serializer is SerializableFileRequestOptions))
                {
                    serializer = new SerializableBlobRequestOptions();
                }

                serializer.RequestOptions = requestOptions;
            }
        }
Exemple #2
0
        internal static void SetRequestOptions(ref SerializableRequestOptions serializer, IRequestOptions requestOptions)
        {
            if (null == serializer && null == requestOptions)
            {
                return;
            }

            if (null == serializer)
            {
                serializer = CreateSerializableRequestOptions(requestOptions);
            }
            else
            {
                if ((requestOptions is FileRequestOptions) &&
                    (serializer is SerializableBlobRequestOptions))
                {
                    serializer = new SerializableFileRequestOptions();
                }
                else if ((requestOptions is BlobRequestOptions) &&
                         (serializer is SerializableFileRequestOptions))
                {
                    serializer = new SerializableBlobRequestOptions();
                }

                serializer.RequestOptions = requestOptions;
            }
        }
        internal static IRequestOptions GetRequestOptions(SerializableRequestOptions serializer)
        {
            if (null == serializer)
            {
                return null;
            }

            return serializer.RequestOptions;
        }
Exemple #4
0
        internal static IRequestOptions GetRequestOptions(SerializableRequestOptions serializer)
        {
            if (null == serializer)
            {
                return(null);
            }

            return(serializer.RequestOptions);
        }
        private AzureFileLocation(SerializationInfo info, StreamingContext context)
        {
            if (info == null)
            {
                throw new System.ArgumentNullException("info");
            }

            this.fileSerializer = (SerializableCloudFile)info.GetValue(AzureFileName, typeof(SerializableCloudFile));
            this.accessCondition = (SerializableAccessCondition)info.GetValue(AccessConditionName, typeof(SerializableAccessCondition));
            this.CheckedAccessCondition = info.GetBoolean(CheckedAccessConditionName);
            this.requestOptions = (SerializableRequestOptions)info.GetValue(RequestOptionsName, typeof(SerializableRequestOptions));
            this.ETag = info.GetString(ETagName);
        }
        private AzureBlobLocation(SerializationInfo info, StreamingContext context)
        {
            if (info == null)
            {
                throw new System.ArgumentNullException("info");
            }

            this.blobSerializer = (SerializableCloudBlob)info.GetValue(BlobName, typeof(SerializableCloudBlob));
            this.accessCondition = (SerializableAccessCondition)info.GetValue(AccessConditionName, typeof(SerializableAccessCondition));
            this.CheckedAccessCondition = info.GetBoolean(CheckedAccessConditionName);
            this.requestOptions = (SerializableBlobRequestOptions)info.GetValue(RequestOptionsName, typeof(SerializableBlobRequestOptions));
            this.ETag = info.GetString(ETagName);
            this.BlockIdPrefix = info.GetString(BlockIDPrefixName);
        }