コード例 #1
0
ファイル: WikiHandler.cs プロジェクト: ashmind/lightwiki
        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
            );
        }
コード例 #2
0
 public WikiPageHierarchyModel GetNextLevel(WikiPage page)
 {
     return new WikiPageHierarchyModel(this.getChildren(page), this.getChildren);
 }
コード例 #3
0
 public WikiPageViewModel(WikiPage page, string html)
 {
     this.Html = html;
     this.Page = page;
 }
コード例 #4
0
ファイル: WikiHandler.cs プロジェクト: ashmind/lightwiki
 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
     );
 }