我们可以在内部使用 Try/CatchQueuedTask.Run()
吗?
我觉得 Try/Catch 应该在外面QueuedTask.Run()
,但我没有理由这样做。请说明是进还是出QueuedTask.Run()
public ICommand CmdEdit
{
get
{
return _cmdEdit ?? (_cmdEdit = new RelayCommand(() =>
{
QueuedTask.Run(() =>
{
try
{
if (_selectedObj != null && SelectedObjs.Count() == 1)
{
OnEditObj(_selectedObj);
}
}
catch (Exception ex)
{
DialogService.ShowPrompt(ex, null, DialogServiceMessage.Message_EditError, DialogServiceCaption.Caption_Exception, DialogServiceButtons.Ok, DialogServiceIcon.Exclamation);
OneGeo.ExceptionLogger.EventLogger.Log(ex);
}
});
}, () => (_selectedObj != null && _selectedObjs.Count() == 1)));
}
}