예제 #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);
        }
예제 #2
0
 public bool Equals(FileSnapshot other)
 {
     return(other != null &&
            other.Name == Name &&
            other.LastModified == LastModified);
 }