Execute() public method

public Execute ( object option ) : System.Threading.Tasks.Task
option object
return System.Threading.Tasks.Task
コード例 #1
0
ファイル: AddAndNewAction.cs プロジェクト: 2sky/Vidyano.Core
        public override async Task <PersistentObject> Execute(object option)
        {
            var idx = Array.IndexOf(Options, (string)option);

            if (idx == Options.Length - 1)
            {
                return(await addAction.Execute(-1).ConfigureAwait(false));
            }

            return(await newAction.Execute(idx).ConfigureAwait(false));
        }
コード例 #2
0
ファイル: Hooks.cs プロジェクト: stevehansen/vidyano_v1
 internal virtual async Task OnActionCommand(ActionBase action, object obj)
 {
     await action.Execute(null);
 }
コード例 #3
0
ファイル: StoreHooks.cs プロジェクト: stevehansen/vidyano_v1
        internal override async Task OnActionCommand(ActionBase action, object obj)
        {
            if (action.Options != null && action.Options.Length > 0)
            {
                var button = obj as Button;
                if (button != null)
                {
                    var popupMenu = new PopupMenu();
                    foreach (var option in action.Options)
                        popupMenu.Commands.Add(new UICommand(option, async c => await action.Execute(c.Label)));

                    var point = button.TransformToVisual(null).TransformPoint(new Point(button.ActualWidth, 0d));
                    await popupMenu.ShowAsync(point);
                    return;
                }
            }

            await action.Execute(null);
        }