private void ProcessChange(WikiPage page, string channelPrefix, string clientId, dynamic data) { var authorRevision = (int)data.revision; var result = updater.ApplyUpdate(page, authorRevision, (string)data.patch); var syncChannel = channelPrefix + "/sync"; var author = this.clientRepository.GetByID(clientId); this.SendSyncMessage( new[] {author}, syncChannel, true, authorRevision, result.ResultingRevision, result.PatchForAuthor ); if (!result.PatchForOthers.Any()) return; this.SendSyncMessage( this.clientRepository.WhereSubscribedTo(syncChannel).Except(author), syncChannel, false, result.ResultingRevision.Number - 1, result.ResultingRevision, result.PatchForOthers ); }
public WikiPageHierarchyModel GetNextLevel(WikiPage page) { return new WikiPageHierarchyModel(this.getChildren(page), this.getChildren); }
public WikiPageViewModel(WikiPage page, string html) { this.Html = html; this.Page = page; }
private void ProcessResync(WikiPage page, string channelPrefix, string clientId, dynamic data) { var sync = updater.GetUpdate(page, (int)data.revision); var author = this.clientRepository.GetByID(clientId); this.SendSyncMessage( new[] { author }, channelPrefix + "/sync", true, (int)data.revision, sync.ResultingRevision, sync.Patch ); }