c# - Should i avoid using invoke?
问题描述
Many times inside my code i am using an async task. When i want to change something inside ui thread then i am using code as described it below. I have already tried and tested this code.
if (this.InvokeRequired)
{
this.Invoke(new MethodInvoker(delegate
{
//Do sruff
}));
}
Is it good practise using invoke? Should i avoid it?
解决方案
推荐阅读
- image - 在颤振中使用多部分上传图像
- r - 尝试将表格图像转换为 BW 并删除 R 中的网格时参数无效
- python - 在 Python3 中编辑 csv 文件
- python - EOFError:Pickle 中的输入用完
- c# - 使用 JavaScriptSerializer 反序列化 json 字符串
- python - whatsapp 聊天导出和转换
- c++ - 如何在 C++ 中输入 total_area 公式?它显示了这些错误
- docker - 在运行过程中在 Docker 中运行命令
- javascript - 如何以编程方式设置 Kendo Date Picker Min 值?
- python - 卡夫卡消费者不显示消息