Exemplo n.º 1
0
        void IDkmClrResultProvider.GetResult(DkmClrValue value, DkmWorkList workList, DkmClrType declaredType, DkmClrCustomTypeInfo declaredTypeInfo, DkmInspectionContext inspectionContext, ReadOnlyCollection <string> formatSpecifiers, string resultName, string resultFullName, DkmCompletionRoutine <DkmEvaluationAsyncResult> completionRoutine)
        {
            if (formatSpecifiers == null)
            {
                formatSpecifiers = Formatter.NoFormatSpecifiers;
            }
            if (resultFullName != null)
            {
                ReadOnlyCollection <string> otherSpecifiers;
                resultFullName = FullNameProvider.GetClrExpressionAndFormatSpecifiers(inspectionContext, resultFullName, out otherSpecifiers);
                foreach (var formatSpecifier in otherSpecifiers)
                {
                    formatSpecifiers = Formatter.AddFormatSpecifier(formatSpecifiers, formatSpecifier);
                }
            }
            var wl = new WorkList(workList, e => completionRoutine(DkmEvaluationAsyncResult.CreateErrorResult(e)));

            wl.ContinueWith(
                () => GetRootResultAndContinue(
                    value,
                    wl,
                    declaredType,
                    declaredTypeInfo,
                    inspectionContext,
                    resultName,
                    resultFullName,
                    formatSpecifiers,
                    result => wl.ContinueWith(() => completionRoutine(new DkmEvaluationAsyncResult(result)))));
        }
Exemplo n.º 2
0
        internal DkmEvaluationAsyncResult FormatAsyncResult(
            string name,
            string fullName,
            DkmClrValue value,
            DkmClrType declaredType = null,
            DkmClrCustomTypeInfo declaredTypeInfo  = null,
            DkmInspectionContext inspectionContext = null
            )
        {
            DkmEvaluationAsyncResult asyncResult = default(DkmEvaluationAsyncResult);
            var workList = new DkmWorkList();

            value.GetResult(
                workList,
                DeclaredType: declaredType ?? value.Type,
                CustomTypeInfo: declaredTypeInfo,
                InspectionContext: inspectionContext ?? DefaultInspectionContext,
                FormatSpecifiers: Formatter.NoFormatSpecifiers,
                ResultName: name,
                ResultFullName: fullName,
                CompletionRoutine: r => asyncResult = r
                );
            workList.Execute();
            return(asyncResult);
        }
Exemplo n.º 3
0
 void IDkmClrResultProvider.GetResult(DkmClrValue value, DkmWorkList workList, DkmClrType declaredType, DkmInspectionContext inspectionContext, ReadOnlyCollection <string> formatSpecifiers, string resultName, string resultFullName, DkmCompletionRoutine <DkmEvaluationAsyncResult> completionRoutine)
 {
     // TODO: Use full name
     GetRootResultAndContinue(value, workList, declaredType, inspectionContext, resultName,
                              result => ContinueWithExceptionHandling(
                                  () => completionRoutine(new DkmEvaluationAsyncResult(result)),
                                  e => completionRoutine(DkmEvaluationAsyncResult.CreateErrorResult(e))));
 }
Exemplo n.º 4
0
        void IDkmClrResultProvider.GetResult(DkmClrValue value, DkmWorkList workList, DkmClrType declaredType, DkmClrCustomTypeInfo declaredTypeInfo, DkmInspectionContext inspectionContext, ReadOnlyCollection <string> formatSpecifiers, string resultName, string resultFullName, DkmCompletionRoutine <DkmEvaluationAsyncResult> completionRoutine)
        {
            // TODO: Use full name
            var wl = new WorkList(workList, e => completionRoutine(DkmEvaluationAsyncResult.CreateErrorResult(e)));

            GetRootResultAndContinue(
                value,
                wl,
                declaredType,
                declaredTypeInfo,
                inspectionContext,
                resultName,
                result => wl.ContinueWith(() => completionRoutine(new DkmEvaluationAsyncResult(result))));
            wl.Execute();
        }