Пример #1
0
        private static List <string> CompareFileMetaData(FileMetaData blobFileMetaData, FileMetaData localFileMetaData)
        {
            var fileMetaDataMessages = new List <string>();

            if (blobFileMetaData.VhdSize != localFileMetaData.VhdSize)
            {
                var message = String.Format("Logical size of VHD file in blob storage ({0}) and local VHD file ({1}) does not match ",
                                            blobFileMetaData.VhdSize,
                                            localFileMetaData.VhdSize);
                fileMetaDataMessages.Add(message);
            }

            if (blobFileMetaData.Size != localFileMetaData.Size)
            {
                var message = String.Format("Size of VHD file in blob storage ({0}) and local VHD file ({1}) does not match ",
                                            blobFileMetaData.Size,
                                            localFileMetaData.Size);
                fileMetaDataMessages.Add(message);
            }

            if (!blobFileMetaData.MD5Hash.SequenceEqual(localFileMetaData.MD5Hash))
            {
                var message = String.Format("MD5 hash of VHD file in blob storage ({0}) and local VHD file ({1}) does not match ",
                                            blobFileMetaData.MD5Hash.ToString(","),
                                            localFileMetaData.MD5Hash.ToString(","));
                fileMetaDataMessages.Add(message);
            }


            if (DateTime.Compare(blobFileMetaData.LastModifiedDateUtc, localFileMetaData.LastModifiedDateUtc) != 0)
            {
                var message = String.Format("Last modified date of VHD file in blob storage ({0}) and local VHD file ({1}) does not match ",
                                            blobFileMetaData.LastModifiedDateUtc,
                                            localFileMetaData.LastModifiedDateUtc);
                fileMetaDataMessages.Add(message);
            }

            if (blobFileMetaData.FileFullName != localFileMetaData.FileFullName)
            {
                var message = String.Format("Full name of VHD file in blob storage ({0}) and local VHD file ({1}) does not match ",
                                            blobFileMetaData.FileFullName,
                                            localFileMetaData.FileFullName);
                fileMetaDataMessages.Add(message);
            }

            if (blobFileMetaData.CreatedDateUtc != localFileMetaData.CreatedDateUtc)
            {
                var message = String.Format("Full name of VHD file in blob storage ({0}) and local VHD file ({1}) does not match ",
                                            blobFileMetaData.CreatedDateUtc,
                                            localFileMetaData.CreatedDateUtc);
                fileMetaDataMessages.Add(message);
            }
            return(fileMetaDataMessages);
        }
        private static List<string> CompareFileMetaData(FileMetaData blobFileMetaData, FileMetaData localFileMetaData)
        {
            var fileMetaDataMessages = new List<string>();
            if (blobFileMetaData.VhdSize != localFileMetaData.VhdSize)
            {
                var message = String.Format("Logical size of VHD file in blob storage ({0}) and local VHD file ({1}) does not match ", 
                                            blobFileMetaData.VhdSize, 
                                            localFileMetaData.VhdSize);
                fileMetaDataMessages.Add(message);
            }

            if (blobFileMetaData.Size != localFileMetaData.Size)
            {
                var message = String.Format("Size of VHD file in blob storage ({0}) and local VHD file ({1}) does not match ",
                                            blobFileMetaData.Size,
                                            localFileMetaData.Size);
                fileMetaDataMessages.Add(message);
            }

            if (!blobFileMetaData.MD5Hash.SequenceEqual(localFileMetaData.MD5Hash))
            {
                var message = String.Format("MD5 hash of VHD file in blob storage ({0}) and local VHD file ({1}) does not match ",
                                            blobFileMetaData.MD5Hash.ToString(","),
                                            localFileMetaData.MD5Hash.ToString(","));
                fileMetaDataMessages.Add(message);
            }

            
            if (DateTime.Compare(blobFileMetaData.LastModifiedDateUtc, localFileMetaData.LastModifiedDateUtc) != 0)
            {
                var message = String.Format("Last modified date of VHD file in blob storage ({0}) and local VHD file ({1}) does not match ",
                                            blobFileMetaData.LastModifiedDateUtc,
                                            localFileMetaData.LastModifiedDateUtc);
                fileMetaDataMessages.Add(message);
            }

            if (blobFileMetaData.FileFullName != localFileMetaData.FileFullName)
            {
                var message = String.Format("Full name of VHD file in blob storage ({0}) and local VHD file ({1}) does not match ",
                                            blobFileMetaData.FileFullName,
                                            localFileMetaData.FileFullName);
                fileMetaDataMessages.Add(message);
            }

            if (blobFileMetaData.CreatedDateUtc != localFileMetaData.CreatedDateUtc)
            {
                var message = String.Format("Full name of VHD file in blob storage ({0}) and local VHD file ({1}) does not match ",
                                            blobFileMetaData.CreatedDateUtc,
                                            localFileMetaData.CreatedDateUtc);
                fileMetaDataMessages.Add(message);
            }
            return fileMetaDataMessages;
        }