当前位置: 首页>>代码示例>>C#>>正文


C# ClrCompilation.DkmClrValue类代码示例

本文整理汇总了C#中Microsoft.VisualStudio.Debugger.Evaluation.ClrCompilation.DkmClrValue的典型用法代码示例。如果您正苦于以下问题:C# DkmClrValue类的具体用法?C# DkmClrValue怎么用?C# DkmClrValue使用的例子?那么恭喜您, 这里精选的类代码示例或许可以为您提供帮助。


DkmClrValue类属于Microsoft.VisualStudio.Debugger.Evaluation.ClrCompilation命名空间,在下文中一共展示了DkmClrValue类的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C#代码示例。

示例1: foreach

 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)))));
 }
开发者ID:CAPCHIK,项目名称:roslyn,代码行数:28,代码来源:ResultProvider.cs

示例2: GetRow

 private DkmEvaluationResult GetRow(
     ResultProvider resultProvider,
     DkmInspectionContext inspectionContext,
     DkmClrValue value,
     int index,
     EvalResultDataItem parent)
 {
     var indices = GetIndices(index);
     var formatter = resultProvider.Formatter;
     var name = formatter.GetArrayIndexExpression(indices);
     var elementType = value.Type.ElementType;
     var element = value.GetArrayElement(indices);
     var fullName = GetFullName(parent, name, formatter);
     var dataItem = resultProvider.CreateDataItem(
         inspectionContext,
         name,
         typeDeclaringMember: null,
         declaredType: elementType.GetLmrType(),
         value: element,
         parent: parent,
         expansionFlags: ExpansionFlags.IncludeBaseMembers,
         childShouldParenthesize: false,
         fullName: fullName,
         formatSpecifiers: Formatter.NoFormatSpecifiers,
         category: DkmEvaluationResultCategory.Other,
         flags: element.EvalFlags,
         evalFlags: inspectionContext.EvaluationFlags);
     return resultProvider.GetResult(dataItem, element.Type, elementType, parent);
 }
开发者ID:elemk0vv,项目名称:roslyn-1,代码行数:29,代码来源:ArrayExpansion.cs

示例3: EvalResultDataItem

        public EvalResultDataItem(
            string name,
            Type typeDeclaringMember,
            Type declaredType,
            DkmClrValue value,
            Expansion expansion,
            bool childShouldParenthesize,
            string fullName,
            string childFullNamePrefixOpt,
            ReadOnlyCollection<string> formatSpecifiers,
            DkmEvaluationResultCategory category,
            DkmEvaluationResultFlags flags,
            string editableValue)
        {
            Debug.Assert(formatSpecifiers != null);
            Debug.Assert((flags & DkmEvaluationResultFlags.Expandable) == 0);

            this.NameOpt = name;
            this.TypeDeclaringMember = typeDeclaringMember;
            this.DeclaredType = declaredType;
            this.Value = value;
            this.ChildShouldParenthesize = childShouldParenthesize;
            this.FullNameWithoutFormatSpecifiers = fullName;
            this.ChildFullNamePrefix = childFullNamePrefixOpt;
            this.FormatSpecifiers = formatSpecifiers;
            this.Category = category;
            this.EditableValue = editableValue;
            this.Flags = flags | GetFlags(value) | ((expansion == null) ? DkmEvaluationResultFlags.None : DkmEvaluationResultFlags.Expandable);
            this.Expansion = expansion;
        }
开发者ID:elemk0vv,项目名称:roslyn-1,代码行数:30,代码来源:EvalResultDataItem.cs

示例4: CreateResultsOnlyRowIfSynthesizedEnumerable

        /// <summary>
        /// Generate a Results Only row if the value is a synthesized
        /// value declared as IEnumerable or IEnumerable&lt;T&gt;.
        /// </summary>
        internal static EvalResultDataItem CreateResultsOnlyRowIfSynthesizedEnumerable(
            DkmInspectionContext inspectionContext,
            string name,
            DkmClrType declaredType,
            DkmClrCustomTypeInfo declaredTypeInfo,
            DkmClrValue value,
            Formatter formatter)
        {
            if ((value.ValueFlags & DkmClrValueFlags.Synthetic) == 0)
            {
                return null;
            }

            // Must be declared as IEnumerable or IEnumerable<T>, not a derived type.
            var enumerableType = GetEnumerableType(value, declaredType, requireExactInterface: true);
            if (enumerableType == null)
            {
                return null;
            }

            var expansion = CreateExpansion(inspectionContext, value, enumerableType, formatter);
            if (expansion == null)
            {
                return null;
            }

            return expansion.CreateResultsViewRow(
                inspectionContext,
                name,
                new TypeAndCustomInfo(declaredType.GetLmrType(), declaredTypeInfo),
                value,
                includeResultsFormatSpecifier: false,
                formatter: formatter);
        }
开发者ID:SoumikMukherjeeDOTNET,项目名称:roslyn,代码行数:38,代码来源:ResultsViewExpansion.cs

示例5: GetValueString

 string IDkmClrFormatter.GetValueString(DkmClrValue value, DkmInspectionContext inspectionContext, ReadOnlyCollection<string> formatSpecifiers)
 {
     var options = ((inspectionContext.EvaluationFlags & DkmEvaluationFlags.NoQuotes) == 0) ?
         ObjectDisplayOptions.UseQuotes :
         ObjectDisplayOptions.None;
     return GetValueString(value, inspectionContext, options, GetValueFlags.IncludeObjectId);
 }
开发者ID:GloryChou,项目名称:roslyn,代码行数:7,代码来源:Formatter.cs

示例6: GetFunctionPointerField

 private DkmClrValue GetFunctionPointerField(DkmClrValue value, string fieldName)
 {
     var valueType = value.Type.GetLmrType();
     var fieldInfo = valueType.GetField(fieldName, BindingFlags.Instance | BindingFlags.Public | BindingFlags.NonPublic);
     var fieldValue = fieldInfo.GetValue(value.RawValue);
     return CreateDkmClrValue(DkmClrValue.UnboxPointer(fieldValue), new DkmClrType(FunctionPointerType.Instance));
 }
开发者ID:XieShuquan,项目名称:roslyn,代码行数:7,代码来源:FunctionPointerTests.cs

示例7: GetRow

 private EvalResult GetRow(
     ResultProvider resultProvider,
     DkmInspectionContext inspectionContext,
     DkmClrValue value,
     int index,
     EvalResultDataItem parent)
 {
     var indices = GetIndices(index);
     var fullNameProvider = resultProvider.FullNameProvider;
     var name = fullNameProvider.GetClrArrayIndexExpression(inspectionContext, indices);
     var element = value.GetArrayElement(indices, inspectionContext);
     var fullName = GetFullName(inspectionContext, parent, name, fullNameProvider);
     return resultProvider.CreateDataItem(
         inspectionContext,
         name,
         typeDeclaringMemberAndInfo: default(TypeAndCustomInfo),
         declaredTypeAndInfo: _elementTypeAndInfo,
         value: element,
         useDebuggerDisplay: parent != null,
         expansionFlags: ExpansionFlags.IncludeBaseMembers,
         childShouldParenthesize: false,
         fullName: fullName,
         formatSpecifiers: Formatter.NoFormatSpecifiers,
         category: DkmEvaluationResultCategory.Other,
         flags: element.EvalFlags,
         evalFlags: inspectionContext.EvaluationFlags);
 }
开发者ID:XieShuquan,项目名称:roslyn,代码行数:27,代码来源:ArrayExpansion.cs

示例8: GetRow

 private EvalResult GetRow(
     DkmInspectionContext inspectionContext,
     DkmClrValue value,
     int index,
     EvalResultDataItem parent)
 {
     var typeParameter = _typeParameters[index];
     var typeArgument = _typeArguments[index];
     var typeArgumentInfo = _customTypeInfoMap.SubstituteCustomTypeInfo(typeParameter, customInfo: null);
     var formatSpecifiers = Formatter.NoFormatSpecifiers;
     return new EvalResult(
         ExpansionKind.TypeVariable,
         typeParameter.Name,
         typeDeclaringMemberAndInfo: default(TypeAndCustomInfo),
         declaredTypeAndInfo: new TypeAndCustomInfo(DkmClrType.Create(value.Type.AppDomain, typeArgument), typeArgumentInfo),
         useDebuggerDisplay: parent != null,
         value: value,
         displayValue: inspectionContext.GetTypeName(DkmClrType.Create(value.Type.AppDomain, typeArgument), typeArgumentInfo, formatSpecifiers),
         expansion: null,
         childShouldParenthesize: false,
         fullName: null,
         childFullNamePrefixOpt: null,
         formatSpecifiers: formatSpecifiers,
         category: DkmEvaluationResultCategory.Data,
         flags: DkmEvaluationResultFlags.ReadOnly,
         editableValue: null,
         inspectionContext: inspectionContext);
 }
开发者ID:XieShuquan,项目名称:roslyn,代码行数:28,代码来源:TypeVariablesExpansion.cs

示例9: GetEnumerableType

        private static DkmClrType GetEnumerableType(DkmClrValue value)
        {
            Debug.Assert(!value.IsError());

            if (value.IsNull)
            {
                return null;
            }

            var valueType = value.Type.GetLmrType();
            // Do not support Results View for strings
            // or arrays. (Matches legacy EE.)
            if (valueType.IsString() || valueType.IsArray)
            {
                return null;
            }

            var enumerableType = valueType.GetIEnumerableImplementationIfAny();
            if (enumerableType == null)
            {
                return null;
            }

            return DkmClrType.Create(value.Type.AppDomain, enumerableType);
        }
开发者ID:elemk0vv,项目名称:roslyn-1,代码行数:25,代码来源:ResultsViewExpansion.cs

示例10: CreateExpansion

        internal static DynamicViewExpansion CreateExpansion(DkmInspectionContext inspectionContext, DkmClrValue value, ResultProvider resultProvider)
        {
            if (value.IsError() || value.IsNull || value.HasExceptionThrown())
            {
                return null;
            }

            var type = value.Type.GetLmrType();
            if (!(type.IsComObject() || type.IsIDynamicMetaObjectProvider()))
            {
                return null;
            }

            var proxyValue = value.InstantiateDynamicViewProxy(inspectionContext);
            Debug.Assert((proxyValue == null) || (!proxyValue.IsNull && !proxyValue.IsError() && !proxyValue.HasExceptionThrown()));
            // InstantiateDynamicViewProxy may return null (if required assembly is missing, for instance).
            if (proxyValue == null)
            {
                return null;
            }

            // Expansion is based on the 'DynamicMetaObjectProviderDebugView.Items' property.
            var proxyType = proxyValue.Type;
            var itemsMemberExpansion = RootHiddenExpansion.CreateExpansion(
                proxyType.GetMemberByName("Items"),
                DynamicFlagsMap.Create(new TypeAndCustomInfo(proxyType)));
            return new DynamicViewExpansion(proxyValue, itemsMemberExpansion);
        }
开发者ID:Rickinio,项目名称:roslyn,代码行数:28,代码来源:DynamicViewExpansion.cs

示例11: GetRows

        internal override void GetRows(
            ResultProvider resultProvider,
            ArrayBuilder<EvalResult> rows,
            DkmInspectionContext inspectionContext,
            EvalResultDataItem parent,
            DkmClrValue value,
            int startIndex,
            int count,
            bool visitAll,
            ref int index)
        {
            var fields = GetFields();

            int startIndex2;
            int count2;
            GetIntersection(startIndex, count, index, fields.Count, out startIndex2, out count2);

            int offset = startIndex2 - index;
            for (int i = 0; i < count2; i++)
            {
                var row = GetMemberRow(resultProvider, inspectionContext, value, fields[i + offset], parent);
                rows.Add(row);
            }

            index += fields.Count;
        }
开发者ID:orthoxerox,项目名称:roslyn,代码行数:26,代码来源:TupleExpansion.cs

示例12: DynamicViewExpansion

        private DynamicViewExpansion(DkmClrValue proxyValue, Expansion proxyMembers)
        {
            Debug.Assert(proxyValue != null);
            Debug.Assert(proxyMembers != null);

            _proxyValue = proxyValue;
            _proxyMembers = proxyMembers;
        }
开发者ID:Rickinio,项目名称:roslyn,代码行数:8,代码来源:DynamicViewExpansion.cs

示例13: CreateExpansion

 internal static ResultsViewExpansion CreateExpansion(DkmInspectionContext inspectionContext, DkmClrValue value, Formatter formatter)
 {
     var enumerableType = GetEnumerableType(value);
     if (enumerableType == null)
     {
         return null;
     }
     return CreateExpansion(inspectionContext, value, enumerableType, formatter);
 }
开发者ID:SoumikMukherjeeDOTNET,项目名称:roslyn,代码行数:9,代码来源:ResultsViewExpansion.cs

示例14: CreateExpansion

 internal static TupleExpansion CreateExpansion(DkmClrValue value, TypeAndCustomInfo declaredTypeAndInfo, int cardinality)
 {
     if (value.IsNull)
     {
         // No expansion.
         return null;
     }
     return new TupleExpansion(new TypeAndCustomInfo(value.Type, declaredTypeAndInfo.Info), cardinality);
 }
开发者ID:orthoxerox,项目名称:roslyn,代码行数:9,代码来源:TupleExpansion.cs

示例15: GetRows

 /// <summary>
 /// Get the rows within the given range. 'index' is advanced
 /// to the end of the range, or if 'visitAll' is true, 'index' is
 /// advanced to the end of the expansion.
 /// </summary>
 internal abstract void GetRows(
     ResultProvider resultProvider,
     ArrayBuilder<DkmEvaluationResult> rows,
     DkmInspectionContext inspectionContext,
     EvalResultDataItem parent,
     DkmClrValue value,
     int startIndex,
     int count,
     bool visitAll,
     ref int index);
开发者ID:elemk0vv,项目名称:roslyn-1,代码行数:15,代码来源:Expansion.cs


注:本文中的Microsoft.VisualStudio.Debugger.Evaluation.ClrCompilation.DkmClrValue类示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。