当前位置: 首页>>代码示例>>C#>>正文


C# IFolder.GetFoldersAsync方法代码示例

本文整理汇总了C#中IFolder.GetFoldersAsync方法的典型用法代码示例。如果您正苦于以下问题:C# IFolder.GetFoldersAsync方法的具体用法?C# IFolder.GetFoldersAsync怎么用?C# IFolder.GetFoldersAsync使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在IFolder的用法示例。


在下文中一共展示了IFolder.GetFoldersAsync方法的3个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C#代码示例。

示例1: IndexFoldersAsync

 private async Task<IEnumerable<TopicData>> IndexFoldersAsync(IFolder folder)
 {
     var folders = await folder.GetFoldersAsync(cancellationToken);
     var foldersArray = folders.Where(IsTopic).ToArray();
     var count = foldersArray.Count();
     Indicator.Report(progress, count);
     var folderTopics = Enumerable.Range(0, count).Select(index =>
         IndexFolderAsync(foldersArray[index], relativePath, index, count));
     var topicsMany = await Task.WhenAll(folderTopics);
     return topicsMany.SelectMany(t => t);
 }
开发者ID:AMDL,项目名称:amdl2maml,代码行数:11,代码来源:FolderIndexer.cs

示例2: DirSize

 public static async Task<long> DirSize(IFolder d, Func<string, long> GetFolderSize, Func<string, long> GetFileSize)
 {
     long Size = 0;
     // Add file sizes.
     IList<IFile> fis = await d.GetFilesAsync();
     foreach (IFile fi in fis)
     {
         Size += GetFileSize(fi.Path);
     }
     // Add subdirectory sizes.
     IList<IFolder> fols = await d.GetFoldersAsync();
     foreach (IFolder fo in fols)
     {
         Size += GetFolderSize(fo.Path);
     }
     return (Size);
 }
开发者ID:GSDan,项目名称:Speeching_Client,代码行数:17,代码来源:Utils.cs

示例3: SearchFolder

            private static IFolder SearchFolder(String[] paths, IFolder storageFolder, int option)
            {
			    if (paths == null || paths.Length <= 0)
			    {
				    return storageFolder;
			    }

			    var foldersTasks = storageFolder.GetFoldersAsync();
			    foldersTasks.Wait ();

			    if (foldersTasks.Exception != null)
			    {
				    throw foldersTasks.Exception;
			    }


			    IList<IFolder> folders = foldersTasks.Result;
			    foreach (IFolder folder in folders) 
			    {
				    for (int i = 0; i < paths.Length; i++) 
				    {
					    if (folder.Name.Equals(paths[i], StringComparison.OrdinalIgnoreCase))
					    {
						    String[] newPaths = new String[paths.Length - 1];

						    int count = 0;
						    for (int j = 1;j < paths.Length; j++)
						    {
							    newPaths[count++] = paths[j];
						    }

						    return SearchFolder(newPaths, folder, option);
					    }
				    }
			    }

			    return null;
            }
开发者ID:gitter-badger,项目名称:core-9,代码行数:38,代码来源:FileUtils.cs


注:本文中的IFolder.GetFoldersAsync方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。