protected override void OnPropertyChanged(string propertyName) { base.OnPropertyChanged(propertyName); if (propertyName == "DriverCardFile") { AsyncHelper.CallAsync(() => { return(DDDReader.Read(DriverCardFile.SerializedFile)); }, result => { TachographCard = result; }, exception => { MessageBoxHelper.ShowError($"{Resources.TXT_ERROR_WHILST_READING_DRIVER_CARD}\n\n{ExceptionPolicy.HandleException(ContainerBootstrapper.Container, exception)}"); }, () => { CloseProgressWindow(); }); ShowProgressWindow(); } }
protected override void OnPropertyChanged(string propertyName) { base.OnPropertyChanged(propertyName); if (propertyName == "WorkshopCardFile") { AsyncHelper.CallAsync(() => { return(DDDReader.Read(WorkshopCardFile.SerializedFile)); }, result => { TachographCard = result; }, exception => { MessageBoxHelper.ShowError(string.Format("{0}\n\n{1}", Resources.TXT_ERROR_WHILST_READING_WORKSHOP_CARD, ExceptionPolicy.HandleException(ContainerBootstrapper.Container, exception))); }, () => { CloseProgressWindow(); }); ShowProgressWindow(); } }
protected void CallAsync <T>(Func <T> beginCall, Action <T> endCall, Action <Exception> exceptionHandler, Action alwaysCall = null) { AsyncHelper.CallAsync(beginCall, endCall, exceptionHandler, alwaysCall); }