异步调用
public async void AsyncSearchDataStart()
{
int res = await WaitSearchData();//等待调用完成
if (res == 1)
{
int ret = App.g_NAVI_Interface.NAVI_GetSearchData();
if (ret == 1)
{
}
}
else
{
}
}
public Task<int> WaitSearchData()
{
var task = new Task<int>(() =>//返回 //异步调用
{
});
task.Start();
return task;
}
//异步调用传参数
public Task<int> WaitSearchData(double xx, double yy)
{
var task = new Task<int>(() => abc(xx, yy)
task.Start();
return task;
}
int abc(double xx, double yy)
{
return 0;
}