コード例 #1
0
ファイル: WikiPage.cs プロジェクト: Umqra/WikiClientLibrary
 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;
 }
コード例 #2
0
 /// <inheritdoc />
 public IEnumerable <IWikiPagePropertyGroup> ParsePropertyGroups(JObject json)
 {
     return(underlyingProvider.ParsePropertyGroups(json));
 }