• 设为首页
  • 点击收藏
  • 手机版
    手机扫一扫访问
    迪恩网络手机版
  • 关注官方公众号
    微信扫一扫关注
    迪恩网络公众号

C# ClrCompilation.DkmClrValue类代码示例

原作者: [db:作者] 来自: [db:来源] 收藏 邀请

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



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


示例16: GetValueString

 string IDkmClrFormatter.GetValueString(DkmClrValue clrValue)
 {
     // TODO: IDkmClrFormatter.GetValueString should have
     // an explicit InspectionContext parameter that is not
     // inherited from the containing DkmClrValue. #1099978
     var options = ((clrValue.InspectionContext.EvaluationFlags & DkmEvaluationFlags.NoQuotes) == 0) ?
         ObjectDisplayOptions.UseQuotes :
         ObjectDisplayOptions.None;
     return GetValueString(clrValue, options, GetValueFlags.IncludeObjectId);
 }
开发者ID:elemk0vv,项目名称:roslyn-1,代码行数:10,代码来源:Formatter.cs


示例17: CreateMembersOnlyRow

 internal static EvalResult CreateMembersOnlyRow(
     DkmInspectionContext inspectionContext,
     string name,
     DkmClrValue value,
     ResultProvider resultProvider)
 {
     var expansion = CreateExpansion(inspectionContext, value, resultProvider);
     return (expansion != null) ?
         expansion.CreateDynamicViewRow(inspectionContext, name, parent: null, fullNameProvider: resultProvider.FullNameProvider) :
         new EvalResult(name, Resources.DynamicViewNotDynamic, inspectionContext);
 }
开发者ID:Rickinio,项目名称:roslyn,代码行数:11,代码来源:DynamicViewExpansion.cs


示例18: CreateMembersOnlyRow

 internal static EvalResultDataItem CreateMembersOnlyRow(
     DkmInspectionContext inspectionContext,
     string name,
     DkmClrValue value,
     Formatter formatter)
 {
     var expansion = CreateExpansion(inspectionContext, value, formatter);
     return (expansion != null) ?
         expansion.CreateDynamicViewRow(inspectionContext, name, parent: null, formatter: formatter) :
         new EvalResultDataItem(name, Resources.DynamicViewNotDynamic);
 }
开发者ID:GloryChou,项目名称:roslyn,代码行数:11,代码来源:DynamicViewExpansion.cs


示例19: GetResult

 internal DkmEvaluationResult GetResult(DkmClrValue value, DkmClrType declaredType, ReadOnlyCollection<string> formatSpecifiers, string resultName, string resultFullName)
 {
     // TODO: Use full name
     try
     {
         return GetRootResult(value, declaredType, resultName);
     }
     catch (Exception e) when (ExpressionEvaluatorFatalError.CrashIfFailFastEnabled(e))
     {
         throw ExceptionUtilities.Unreachable;
     }
 }
开发者ID:elemk0vv,项目名称:roslyn-1,代码行数:12,代码来源:ResultProvider.cs


示例20: TryFormatValue

        /// <summary>
        /// This method is called by the debug engine to populate the text representing the value
        /// of an expression.
        /// </summary>
        /// <param name="clrValue">The raw value to get the text for</param>
        /// <param name="inspectionContext">Context of the evaluation.  This contains options/flags
        /// to be used during compilation. It also contains the InspectionSession.  The inspection
        /// session is the object that provides lifetime management for our objects.  When the user
        /// steps or continues the process, the debug engine will dispose of the inspection session</param>
        /// <param name="formatSpecifiers"></param>
        /// <returns>The text representing the given value</returns>
        string IDkmClrFormatter.GetValueString(DkmClrValue clrValue, DkmInspectionContext inspectionContext, ReadOnlyCollection<string> formatSpecifiers)
        {
            DkmClrType clrType = clrValue.Type;
            if (clrType == null)
            {
                // This can be null in some error cases
                return string.Empty;
            }

            // Try to format the value.  If we can't format the value, delegate to the C# Formatter.
            string value = TryFormatValue(clrValue, inspectionContext);
            return value ?? clrValue.GetValueString(inspectionContext, formatSpecifiers);
        }
开发者ID:OToL,项目名称:ConcordExtensibilitySamples,代码行数:24,代码来源:IrisFormatter.cs



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


鲜花

握手

雷人

路过

鸡蛋
该文章已有0人参与评论

请发表评论

全部评论

专题导读
上一篇:
C# ProjectSystem.AbstractProject类代码示例发布时间:2022-05-26
下一篇:
C# Evaluation.DkmInspectionContext类代码示例发布时间:2022-05-26
热门推荐
阅读排行榜

扫描微信二维码

查看手机版网站

随时了解更新最新资讯

139-2527-9053

在线客服(服务时间 9:00~18:00)

在线QQ客服
地址:深圳市南山区西丽大学城创智工业园
电邮:jeky_zhao#qq.com
移动电话:139-2527-9053

Powered by 互联科技 X3.4© 2001-2213 极客世界.|Sitemap