本文整理汇总了C#中IFile.Select方法的典型用法代码示例。如果您正苦于以下问题:C# IFile.Select方法的具体用法?C# IFile.Select怎么用?C# IFile.Select使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类IFile
的用法示例。
在下文中一共展示了IFile.Select方法的2个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C#代码示例。
示例1: Walk
/// <summary>
/// Walks the given files recursively to obtain the full tree.
/// This triggers List requests against Google Drive.
/// </summary>
/// <param name="walker"></param>
/// <param name="files"></param>
/// <returns></returns>
private static IFileNode[] Walk(IWalker walker, IFile[] files)
{
return files.Select(f => walker.ListRecurse(f)).ToArray();
}
示例2: DeleteDocuments
public async Task<bool> DeleteDocuments (IFile[] files, UIBarButtonItem deleteButton)
{
if (DismissSheetsAndPopovers ())
return false;
if (files.Length == 0)
return false;
//
// Ask if we should delete
//
var tcs = new TaskCompletionSource<int> ();
ActionSheet = new UIActionSheet ();
ActionSheet.AddButton ("Delete " + DescribeFiles (files));
ActionSheet.AddButton ("Cancel");
ActionSheet.DestructiveButtonIndex = 0;
ActionSheet.CancelButtonIndex = 1;
ActionSheet.Clicked += (ss, se) => {
try {
tcs.SetResult ((int)se.ButtonIndex);
} catch (Exception ex) {
Log.Error (ex);
}
};
ActionSheet.ShowFrom (deleteButton, true);
var button = await tcs.Task;
if (button != 0)
return false;
//
// Perform the delete
//
try {
await DeleteDocs (files.Select(x => x.Path).ToArray());
foreach (var f in files) {
InvalidateThumbnail (f, deleteThumbnail: true, reloadThumbnail: false);
}
} catch (Exception ex) {
Console.WriteLine (ex);
}
return true;
}