private static void EvaluateDebuggerDisplayStringAndContinue(
            DkmClrValue value,
            WorkList workList,
            DkmInspectionContext inspectionContext,
            DkmClrType targetType,
            string str,
            CompletionRoutine<DkmEvaluateDebuggerDisplayStringAsyncResult> onCompleted,
            CompletionRoutine<Exception> onException)
        {
            DkmCompletionRoutine<DkmEvaluateDebuggerDisplayStringAsyncResult> completionRoutine =
                result =>
                {
                    try
                    {
                        onCompleted(result);
                    }
                    catch (Exception e)
                    {
                        onException(e);
                    }

                    workList.Execute();
                };
            if (str == null)
            {
                completionRoutine(default(DkmEvaluateDebuggerDisplayStringAsyncResult));
            }
            else
            {
                value.EvaluateDebuggerDisplayString(workList.InnerWorkList, inspectionContext, targetType, str, completionRoutine);
            }
        }
Example #2
0
 private static void EvaluateDebuggerDisplayStringAndContinue(
     DkmClrValue value,
     WorkList workList,
     DkmInspectionContext inspectionContext,
     DkmClrType targetType,
     string str,
     CompletionRoutine<DkmEvaluateDebuggerDisplayStringAsyncResult> onCompleted,
     CompletionRoutine<Exception> onException)
 {
     DkmCompletionRoutine<DkmEvaluateDebuggerDisplayStringAsyncResult> completionRoutine =
         result =>
         {
             try
             {
                 onCompleted(result);
             }
             catch (Exception e) when (ExpressionEvaluatorFatalError.ReportNonFatalException(e, DkmComponentManager.ReportCurrentNonFatalException))
             {
                 onException(e);
             }
         };
     if (str == null)
     {
         completionRoutine(default(DkmEvaluateDebuggerDisplayStringAsyncResult));
     }
     else
     {
         value.EvaluateDebuggerDisplayString(workList.InnerWorkList, inspectionContext, targetType, str, completionRoutine);
     }
 }