本文整理汇总了C#中Form.ToActionSheet方法的典型用法代码示例。如果您正苦于以下问题:C# Form.ToActionSheet方法的具体用法?C# Form.ToActionSheet怎么用?C# Form.ToActionSheet使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类Form
的用法示例。
在下文中一共展示了Form.ToActionSheet方法的1个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C#代码示例。
示例1: ShowAddUI
public void ShowAddUI (UIBarButtonItem addButton, bool dup, bool folder)
{
if (DismissSheetsAndPopovers ()) {
return;
}
var directory = CurrentDocumentListController.Directory;
if (!ActiveFileSystem.IsWritable)
return;
var form = new Form {
new FormAction (
"New " + App.DocumentBaseName,
async () => await AddAndOpenNewDocument ()),
};
var pbtext = GetPasteboardText ();
if (ShowAddFromClipboard && !string.IsNullOrWhiteSpace (pbtext) && lastClipboard != pbtext) {
lastClipboard = pbtext;
form.Add (new FormAction (
"From Clipboard",
async () => await AddAndOpenDocRef (await DocumentReference.New (
directory,
App.DocumentBaseName,
App.DefaultExtension,
ActiveFileSystem,
App.CreateDocument,
GetNewDocumentText () + pbtext))));
}
var odi = OpenedDocIndex;
var source = (dup && 0 <= odi && odi < Docs.Count) ?
Docs [odi] :
null;
if (source != null) {
form.Add (new FormAction (
"Duplicate",
async () => await AddAndOpenDocRef (await source.Duplicate (ActiveFileSystem))));
}
if (folder && GetDirectoryDepth (directory) < ActiveFileSystem.MaxDirectoryDepth) {
form.Add (new FormAction (
"Folder",
AddFolder));
}
if (form.Count > 1) {
form.Title = "Add";
form.Add (new FormAction ("Cancel"));
ActionSheet = form.ToActionSheet ();
ActionSheet.ShowFrom (addButton, true);
} else {
((FormAction)form [0]).Execute ();
}
}