/// <summary>
        /// Serializes the object.
        /// </summary>
        /// <param name="info">Serialization info object.</param>
        /// <param name="context">Streaming context.</param>
        public void GetObjectData(SerializationInfo info, StreamingContext context)
        {
            if (info == null)
            {
                throw new ArgumentNullException("info");
            }

            FileListContinuationToken fileLct = this.ListContinuationToken as FileListContinuationToken;

            if (fileLct != null)
            {
                info.AddValue(ListContinuationTokenTypeName, TokenTypeFile, typeof(string));
                info.AddValue(ListContinuationTokenName, fileLct, typeof(FileListContinuationToken));
                return;
            }

            AzureBlobListContinuationToken azureBlobLct = this.ListContinuationToken as AzureBlobListContinuationToken;

            if (azureBlobLct != null)
            {
                info.AddValue(ListContinuationTokenTypeName, TokenTypeAzureBlob, typeof(string));
                info.AddValue(ListContinuationTokenName, azureBlobLct, typeof(AzureBlobListContinuationToken));
                return;
            }

            AzureFileListContinuationToken azureFileLct = this.ListContinuationToken as AzureFileListContinuationToken;

            if (azureFileLct != null)
            {
                info.AddValue(ListContinuationTokenTypeName, TokenTypeAzureFile, typeof(string));
                info.AddValue(ListContinuationTokenName, azureFileLct, typeof(AzureFileListContinuationToken));
                return;
            }

            throw new ArgumentException("ListContinuationToken");
        }
示例#2
0
 /// <summary>
 /// Initializes a new instance of the <see cref="AzureFileEntry" /> class.
 /// </summary>
 /// <param name="relativePath">Relative path of the file indicated by this file entry.</param>
 /// <param name="cloudFile">Corresponding CloudFile.</param>
 /// <param name="continuationToken">Continuation token when listing to this entry.</param>
 public AzureFileEntry(string relativePath, CloudFile cloudFile, AzureFileListContinuationToken continuationToken)
     : base(relativePath, continuationToken)
 {
     this.File = cloudFile;
 }
 /// <summary>
 /// Initializes a new instance of the <see cref="AzureFileEntry" /> class.
 /// </summary>
 /// <param name="relativePath">Relative path of the file indicated by this file entry.</param>
 /// <param name="cloudFile">Corresponding CloudFile.</param>
 /// <param name="continuationToken">Continuation token when listing to this entry.</param>
 public AzureFileEntry(string relativePath, CloudFile cloudFile, AzureFileListContinuationToken continuationToken)
     : base(relativePath, continuationToken)
 {
     this.File = cloudFile;
 }