Exemplo n.º 1
0
        private FileMessage ReadSnapshot(FileSnapshot snapshot)
        {
            var fileMessage = new FileMessage {
                Name = snapshot.Name
            };

            try {
                var fileInfo = new FileInfo(snapshot.Name);
                if (fileInfo.Exists)
                {
                    var fileBytes = ExclusiveRead(fileInfo);
                    fileMessage.Content       = Encoding.UTF8.GetString(fileBytes);
                    fileMessage.ContentLength = fileBytes.LongLength;
                }
            } catch { }

            return(fileMessage);
        }
Exemplo n.º 2
0
 public bool Equals(FileSnapshot other)
 {
     return(other != null &&
            other.Name == Name &&
            other.LastModified == LastModified);
 }