Command.Execute C# (CSharp) Method

Execute() public abstract method

public abstract Execute ( ) : void
return void
    public abstract void Execute();

Usage Example

示例#1
0
        /// <summary>
        /// Save the new color
        /// </summary>
        /// <param name="sender">The sender<see cref="object"/></param>
        /// <param name="e">The e<see cref="EventArgs"/></param>
        private async void btnSave_Clicked(object sender, EventArgs e)
        {
            if (_oDevice.Protected)
            {
                var r = await UserDialogs.Instance.PromptAsync(AppResources.welcome_remote_server_password,
                                                               inputType : InputType.Password);

                await Task.Delay(500);

                if (r.Ok)
                {
                    var result = await App.ApiService.SetColor(_oDevice.idx, colorMixer.ColorVal.Value, r.Text);

                    if (!result)
                    {
                        App.ShowToast(AppResources.security_wrong_code);
                    }
                    _cmFinish?.Execute(null);
                    await PopupNavigation.Instance.PopAsync();
                }
            }
            else
            {
                await App.ApiService.SetColor(_oDevice.idx, colorMixer.ColorVal.Value);

                _cmFinish?.Execute(null);
                await PopupNavigation.Instance.PopAsync();
            }
        }
All Usage Examples Of Command::Execute