コード例 #1
0
 public async Task <Tuple <bool, ImmutableWikiDirectory> > GetDirectory(string fullPath)
 {
     return(await Task.Run(() =>
     {
         if (UnderlyingModel.ContainsAssetBySourcePath(fullPath))
         {
             ImmutableWikiEntry entry = UnderlyingModel.GetImmutableAssetBySourcePath(fullPath);
             if (entry is ImmutableWikiDirectory)
             {
                 return new Tuple <bool, ImmutableWikiDirectory>(true, entry as ImmutableWikiDirectory);
             }
             else
             {
                 return new Tuple <bool, ImmutableWikiDirectory>(false, null);
             }
         }
         else
         {
             return new Tuple <bool, ImmutableWikiDirectory>(false, null);
         }
     }));
 }
コード例 #2
0
 public async Task <Tuple <bool, ImmutableWikiPage> > GetPageByWikiUrl(string url)
 {
     return(await Task.Run(() =>
     {
         if (UnderlyingModel.ContainsAssetBySourcePath(url))
         {
             ImmutableWikiEntry entry = UnderlyingModel.GetImmutableAssetByWikiUrl(url);
             if (entry is ImmutableWikiPage)
             {
                 return new Tuple <bool, ImmutableWikiPage>(true, entry as ImmutableWikiPage);
             }
             else
             {
                 return new Tuple <bool, ImmutableWikiPage>(false, null);
             }
         }
         else
         {
             return new Tuple <bool, ImmutableWikiPage>(false, null);
         }
     }));
 }