예제 #1
0
        public void ConflictNotificationSerialization()
        {
			var metadata = new RavenJObject { { Constants.LastModified, "2014-07-07T12:00:00.0000000" }, { Constants.FileSystem.RavenFsSize, "128" } };
            var fileHeader = new FileHeader("test1.file", metadata);
            var notification = new ConflictNotification() { FileName = "test1.file", SourceServerUrl = "http://destination", RemoteFileHeader = fileHeader, Status = ConflictStatus.Detected};

            var serializedValue = JsonExtensions.ToJObject(notification);

            var jr = new RavenJTokenReader(serializedValue);
            var deserializedValue = JsonExtensions.CreateDefaultJsonSerializer().Deserialize<ConflictNotification>(jr);

            Assert.NotNull(deserializedValue);
        }
예제 #2
0
 internal void OnFileConflict(ConflictNotification notification)
 {
     if ( notification.Status == ConflictStatus.Detected)
     {
         conflicts.Add(notification.FileName);                
     }
     else
     {
         entitiesByKey.Remove(notification.FileName);
         conflicts.Remove(notification.FileName);
     }            
 }
예제 #3
0
 public void Send(ConflictNotification conflictsNotification)
 {
     var onConflictNotification = OnConflictsNotification;
     if (onConflictNotification != null)
         onConflictNotification(conflictsNotification);
 }