本文整理汇总了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)))));
}
示例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);
}
示例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;
}
示例4: CreateResultsOnlyRowIfSynthesizedEnumerable
/// <summary>
/// Generate a Results Only row if the value is a synthesized
/// value declared as IEnumerable or IEnumerable<T>.
/// </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);
}
示例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);
}
示例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));
}
示例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);
}
示例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);
}
示例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);
}
示例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);
}
示例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;
}
示例12: DynamicViewExpansion
private DynamicViewExpansion(DkmClrValue proxyValue, Expansion proxyMembers)
{
Debug.Assert(proxyValue != null);
Debug.Assert(proxyMembers != null);
_proxyValue = proxyValue;
_proxyMembers = proxyMembers;
}
示例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);
}
示例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);
}
示例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);