コード例 #1
0
        public static void ProcessFailure(object sender, FailuresProcessingEventArgs args)
        {
            try
            {
                if (isElementModified && null != currentDoc)
                {
                    FailuresAccessor fa = args.GetFailuresAccessor();

                    DTMWindow dtmWindow = new DTMWindow(currentDoc, elementModified);
                    if ((bool)dtmWindow.ShowDialog())
                    {
                        args.SetProcessingResult(FailureProcessingResult.ProceedWithRollBack);
                        FailureHandlingOptions option = fa.GetFailureHandlingOptions();
                        option.SetClearAfterRollback(true);
                        fa.SetFailureHandlingOptions(option);
                    }
                    isElementModified = false;
                }
            }
            catch (Exception ex)
            {
                string message = ex.Message;
                LogUtil.AppendLog("DTMFailure-ProcessFailure:" + ex.Message);
            }
        }
コード例 #2
0
        public static void ProcessFailure(object sender, FailuresProcessingEventArgs args)
        {
            try
            {
                if (!IsElementModified || CurrentDoc == null)
                {
                    return;
                }

                FailureProcessor.IsFailureProcessing = true;
                var fa = args.GetFailuresAccessor();

                var dtmViewModel = new DTMViewModel(CurrentDoc, ElementModified);
                var dtmWindow    = new DTMWindow {
                    DataContext = dtmViewModel
                };
                var showDialog = dtmWindow.ShowDialog();
                if (showDialog != null && (bool)showDialog)
                {
                    args.SetProcessingResult(FailureProcessingResult.ProceedWithRollBack);
                    var option = fa.GetFailureHandlingOptions();
                    option.SetClearAfterRollback(true);
                    fa.SetFailureHandlingOptions(option);
                }
                IsElementModified = false;
                FailureProcessor.IsFailureProcessing = false;
            }
            catch (Exception ex)
            {
                Log.AppendLog(LogMessageType.EXCEPTION, ex.Message);
            }
        }