Inheritance: UITableViewController
コード例 #1
0
            public override bool SelectItem(object item)
            {
                if (item == addStorage)
                {
                    var chooseProviderForm = new PForm("Add Storage");
                    chooseProviderForm.Sections.Add(new FileSystemProvidersSection());

                    Form.NavigationController.PushViewController(chooseProviderForm, true);

                    return(true);
                }

                var fs = item as IFileSystem;

                SetNeedsFormat();

                Form?.DismissAsync(true).ContinueWith(t => {
                    if (t.IsFaulted)
                    {
                        Log.Error(t.Exception);
                    }
                });
                DocumentAppDelegate.Shared.SetFileSystemAsync(fs, true).ContinueWith(t => {
                    if (t.IsFaulted)
                    {
                        Log.Error(t.Exception);
                    }
                });

                return(true);
            }
コード例 #2
0
        public static UIActionSheet ToActionSheet(this PForm form)
        {
            var q = from s in form.Sections
                    from i in s.Items
                    let c = i as Command
                            where c != null
                            select c;
            var actions = q.ToList();

            var ActionSheet = new UIActionSheet(form.Title);

            foreach (var a in actions)
            {
                ActionSheet.Add(a.Name);
            }

            ActionSheet.CancelButtonIndex = ActionSheet.ButtonCount - 1;

            ActionSheet.Clicked += async(ss, se) => {
                var index = (int)se.ButtonIndex;
                if (0 <= index && index < actions.Count)
                {
                    try {
                        await actions[index].ExecuteAsync();
                    } catch (Exception ex) {
                        Console.WriteLine("Failed to execute action: " + ex);
                    }
                }
            };

            return(ActionSheet);
        }
コード例 #3
0
            public override bool SelectItem(object item)
            {
                if (item == addStorage)
                {
                    var chooseProviderForm = new PForm("Add Storage");
                    chooseProviderForm.Sections.Add(new FileSystemProvidersSection());

                    Form.NavigationController.PushViewController(chooseProviderForm, true);

                    return(true);
                }

                var fs = item as IFileSystem;

                SetNeedsFormat();
                if (Form != null)
                {
                    Form.DismissAsync(true);
                }
                DocumentAppDelegate.Shared.SetFileSystemAsync(fs, true);

                return(true);
            }
コード例 #4
0
 public FormSource(PForm controller)
 {
     this.controller = controller;
 }
コード例 #5
0
ファイル: StorageForm.cs プロジェクト: praeclarum/Praeclarum
			public override bool SelectItem (object item)
			{
				if (item == addStorage) {

					var chooseProviderForm = new PForm ("Add Storage");
					chooseProviderForm.Sections.Add (new FileSystemProvidersSection ());

					Form.NavigationController.PushViewController (chooseProviderForm, true);

					return true;
				}

				var fs = item as IFileSystem;
				SetNeedsFormat ();
				if (Form != null)
					Form.DismissAsync (true);
				DocumentAppDelegate.Shared.SetFileSystemAsync (fs, true);

				return true;
			}
コード例 #6
0
			public FormSource (PForm controller)
			{
				this.controller = controller;
			}