/// <summary> Gets alert configuration. </summary> /// <exception cref="ArgumentNullException"> Thrown when one or more required arguments are null. </exception> /// <param name="config"> The configuration. </param> /// <returns> The alert configuration. </returns> private AcrDialogs.AlertConfig GetAlertConfig(UserDialogAlertConfig config) { if (config == null) { throw new ArgumentNullException(nameof(config)); } var result = new AcrDialogs.AlertConfig(); if (config.OkText != null) { result.OkText = config.OkText; } if (config.Title != null) { result.Title = config.Title; } if (config.Message != null) { result.Message = config.Message; } if (config.AndroidStyleId != null) { result.AndroidStyleId = config.AndroidStyleId; } if (config.OnAction != null) { result.OnAction = config.OnAction; } return(result); }
/// <summary> Alert asynchronous. </summary> /// <param name="config"> The configuration. </param> /// <param name="cancelToken"> (Optional) The cancel token. </param> /// <returns> The asynchronous result. </returns> public Task AlertAsync(UserDialogAlertConfig config, CancellationToken?cancelToken = null) { return(AcrDialogs.UserDialogs.Instance.AlertAsync(GetAlertConfig(config))); }
/// <summary> Alerts the given configuration. </summary> /// <param name="config"> The configuration. </param> /// <returns> An IDisposable. </returns> public IDisposable Alert(UserDialogAlertConfig config) { return(AcrDialogs.UserDialogs.Instance.Alert(GetAlertConfig(config))); }