public void Send(ConflictNotification conflictsNotification) { var onConflictNotification = OnConflictsNotification; if (onConflictNotification != null) { onConflictNotification(conflictsNotification); } }
internal void OnFileConflict(ConflictNotification notification) { if (notification.Status == ConflictStatus.Detected) { conflicts.Add(notification.FileName); } else { entitiesByKey.Remove(notification.FileName); conflicts.Remove(notification.FileName); } }
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); }
private static void NotifyConflictSubscribers(IEnumerable <KeyValuePair <string, FilesConnectionState> > connections, ConflictNotification conflictNotification) { // Check if we are delaying the broadcast. if (conflictNotification != null) { foreach (var counter in connections) { counter.Value.Send(conflictNotification); } } }
public void Send(ConflictNotification conflictsNotification) { var onConflictNotification = OnConflictsNotification; if (onConflictNotification != null) onConflictNotification(conflictsNotification); }
private static void NotifyConflictSubscribers(List <FilesConnectionState> connections, ConflictNotification conflictNotification) { // Check if we are delaying the broadcast. if (conflictNotification != null) { foreach (var counter in connections) { counter.Send(conflictNotification); } } }