/// <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");
            }

            if (null != this.ListContinuationToken)
            {
                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;
                }
            }
            else
            {
                info.AddValue(ListContinuationTokenTypeName, "", typeof(string));
            }
        }
 /// <summary>
 /// Initializes a new instance of the <see cref="AzureFileDirectoryEntry" /> class.
 /// </summary>
 /// <param name="relativePath">Relative path of the directory indicated by this directory entry.</param>
 /// <param name="cloudFileDirectory">Corresponding CloudFileDirectory instance.</param>
 /// <param name="continuationToken">Continuation token when listing to this entry.</param>
 public AzureFileDirectoryEntry(string relativePath, CloudFileDirectory cloudFileDirectory, AzureFileListContinuationToken continuationToken)
     : base(relativePath, continuationToken)
 {
     this.FileDirectory = cloudFileDirectory;
 }
Пример #3
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;
 }