Example #1
0
 protected internal virtual void OnLoadPageInfo(JObject jpage, IWikiPageQueryProvider options)
 {
     // Initialize
     propertyGroups?.Clear();
     // Update page stub
     PageStub = MediaWikiHelper.PageStubFromJson(jpage);
     // Load page info
     // Invalid page title (like File:)
     if (PageStub.IsInvalid)
     {
         return;
     }
     // Load property groups
     foreach (var group in options.ParsePropertyGroups(jpage))
     {
         Debug.Assert(group != null, "The returned sequence from IWikiPageQueryParameters.ParsePropertyGroups contains null item.");
         if (propertyGroups == null)
         {
             propertyGroups = new List <IWikiPagePropertyGroup>();
         }
         propertyGroups.Add(group);
     }
     // Check if the client has requested for revision content…
     LastRevision = GetPropertyGroup <RevisionsPropertyGroup>()?.LatestRevision;
     if (LastRevision?.Content != null)
     {
         Content = LastRevision.Content;
     }
     LastFileRevision = GetPropertyGroup <FileInfoPropertyGroup>()?.LatestRevision;
     pageInfo         = GetPropertyGroup <PageInfoPropertyGroup>();
     LastRevisionId   = pageInfo?.LastRevisionId ?? 0;
     ContentModel     = pageInfo?.ContentModel;
 }
Example #2
0
 /// <inheritdoc />
 public IEnumerable <IWikiPagePropertyGroup> ParsePropertyGroups(JObject json)
 {
     return(underlyingProvider.ParsePropertyGroups(json));
 }