コード例 #1
0
        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();
            }
        }
コード例 #2
0
        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();
            }
        }
コード例 #3
0
 protected void CallAsync <T>(Func <T> beginCall, Action <T> endCall, Action <Exception> exceptionHandler, Action alwaysCall = null)
 {
     AsyncHelper.CallAsync(beginCall, endCall, exceptionHandler, alwaysCall);
 }