我有一个下载任务,它通过4个步骤从Web下载数据,这些步骤被定义为异步任务并逐个运行.现在由于一些变化,我需要从任务2和3之间的自定义对话框中捕获用户输入.我已经编写了一个函数来捕获来自AlertDialog的输入.问题是两者之间的对话框显示,但它只是等待并停止处理并继续处理而不需要用户输入.代码是这样的:
async void button_click(......){
await function1();
await function2();
await function3();
await function4();
....do the data processing after that.
}
async Task<datatype> function1(){ ...processing step 1 }
async Task<datatype> function2(){
new AlertDialog.Builder(this)
.SetPositiveButton("OK", (sender, args) =>
{
string inputText = txtInput.Text;
})
.SetView(customView)
.Show();
.... some more processing
}
Run Code Online (Sandbox Code Playgroud)
有什么办法我可以停止处理,直到从AlertDialog或任何其他方式做同样的用户输入?
xamarin.android android-asynctask android-alertdialog xamarin
opencart中有一个函数,我需要替换如下:
protected function validateDelete() {
if (!$this->user->hasPermission('modify', 'catalog/download')) {
$this->error['warning'] = $this->language->get('error_permission');
Run Code Online (Sandbox Code Playgroud)
应该:
protected function validateDelete() {
if (!$this->user->hasPermission('delete', 'catalog/download')) {
$this->error['warning'] = $this->language->get('error_permission_delete');
Run Code Online (Sandbox Code Playgroud)
我试过了:
<search position="replace"><![CDATA[
protected function validateDelete() {
if (!$this->user->hasPermission('modify',]]></search>
<add><![CDATA[
protected function validateDelete() {
if (!$this->user->hasPermission('delete',
]]></add>
Run Code Online (Sandbox Code Playgroud)
但它不起作用.第三行出现在多个位置,因此无法单行替换.
请帮忙