本文整理汇总了C#中enum_DEBUGPROP_INFO_FLAGS.HasFlag方法的典型用法代码示例。如果您正苦于以下问题:C# enum_DEBUGPROP_INFO_FLAGS.HasFlag方法的具体用法?C# enum_DEBUGPROP_INFO_FLAGS.HasFlag怎么用?C# enum_DEBUGPROP_INFO_FLAGS.HasFlag使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类enum_DEBUGPROP_INFO_FLAGS
的用法示例。
在下文中一共展示了enum_DEBUGPROP_INFO_FLAGS.HasFlag方法的9个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C#代码示例。
示例1: ConstructDebugPropertyInfo
// Construct a DEBUG_PROPERTY_INFO representing this local or parameter.
public DEBUG_PROPERTY_INFO ConstructDebugPropertyInfo(uint radix, enum_DEBUGPROP_INFO_FLAGS dwFields) {
var propertyInfo = new DEBUG_PROPERTY_INFO();
if (dwFields.HasFlag(enum_DEBUGPROP_INFO_FLAGS.DEBUGPROP_INFO_FULLNAME)) {
propertyInfo.bstrFullName = _evaluationResult.FullName;
propertyInfo.dwFields |= enum_DEBUGPROP_INFO_FLAGS.DEBUGPROP_INFO_FULLNAME;
}
if (dwFields.HasFlag(enum_DEBUGPROP_INFO_FLAGS.DEBUGPROP_INFO_NAME)) {
propertyInfo.bstrName = _evaluationResult.Expression;
propertyInfo.dwFields |= enum_DEBUGPROP_INFO_FLAGS.DEBUGPROP_INFO_NAME;
}
if (dwFields.HasFlag(enum_DEBUGPROP_INFO_FLAGS.DEBUGPROP_INFO_TYPE)) {
propertyInfo.bstrType = _evaluationResult.TypeName;
propertyInfo.dwFields |= enum_DEBUGPROP_INFO_FLAGS.DEBUGPROP_INFO_TYPE;
}
if (dwFields.HasFlag(enum_DEBUGPROP_INFO_FLAGS.DEBUGPROP_INFO_VALUE)) {
string value = radix == 16 ? _evaluationResult.HexValue ?? _evaluationResult.StringValue : _evaluationResult.StringValue;
propertyInfo.bstrValue = _evaluationResult.Type.HasFlag(NodeExpressionType.String) ? string.Format("\"{0}\"", value) : value;
propertyInfo.dwFields |= enum_DEBUGPROP_INFO_FLAGS.DEBUGPROP_INFO_VALUE;
}
if (dwFields.HasFlag(enum_DEBUGPROP_INFO_FLAGS.DEBUGPROP_INFO_ATTRIB)) {
if (_evaluationResult.Type.HasFlag(NodeExpressionType.ReadOnly)) {
propertyInfo.dwAttrib |= enum_DBG_ATTRIB_FLAGS.DBG_ATTRIB_VALUE_READONLY;
}
if (_evaluationResult.Type.HasFlag(NodeExpressionType.Private)) {
propertyInfo.dwAttrib |= enum_DBG_ATTRIB_FLAGS.DBG_ATTRIB_ACCESS_PRIVATE;
}
if (_evaluationResult.Type.HasFlag(NodeExpressionType.Expandable)) {
propertyInfo.dwAttrib |= enum_DBG_ATTRIB_FLAGS.DBG_ATTRIB_OBJ_IS_EXPANDABLE;
}
if (_evaluationResult.Type.HasFlag(NodeExpressionType.String)) {
propertyInfo.dwAttrib |= enum_DBG_ATTRIB_FLAGS.DBG_ATTRIB_VALUE_RAW_STRING;
}
if (_evaluationResult.Type.HasFlag(NodeExpressionType.Boolean)) {
propertyInfo.dwAttrib |= enum_DBG_ATTRIB_FLAGS.DBG_ATTRIB_VALUE_BOOLEAN;
}
if (_evaluationResult.Type.HasFlag(NodeExpressionType.Property)) {
propertyInfo.dwAttrib |= enum_DBG_ATTRIB_FLAGS.DBG_ATTRIB_PROPERTY;
}
if (_evaluationResult.Type.HasFlag(NodeExpressionType.Function)) {
propertyInfo.dwAttrib |= enum_DBG_ATTRIB_FLAGS.DBG_ATTRIB_METHOD;
}
}
// Always provide the property so that we can access locals from the automation object.
propertyInfo.pProperty = this;
propertyInfo.dwFields |= enum_DEBUGPROP_INFO_FLAGS.DEBUGPROP_INFO_PROP;
return propertyInfo;
}
示例2: GetPropertyInfo
public int GetPropertyInfo(enum_DEBUGPROP_INFO_FLAGS dwFields, uint dwRadix, uint dwTimeout, IDebugReference2[] rgpArgs, uint dwArgCount, DEBUG_PROPERTY_INFO[] pPropertyInfo) {
pPropertyInfo[0] = new DEBUG_PROPERTY_INFO();
if (dwFields.HasFlag(enum_DEBUGPROP_INFO_FLAGS.DEBUGPROP_INFO_ATTRIB)) {
pPropertyInfo[0].dwAttrib = enum_DBG_ATTRIB_FLAGS.DBG_ATTRIB_VALUE_ERROR;
pPropertyInfo[0].dwFields |= enum_DEBUGPROP_INFO_FLAGS.DEBUGPROP_INFO_ATTRIB;
}
if (dwFields.HasFlag(enum_DEBUGPROP_INFO_FLAGS.DEBUGPROP_INFO_VALUE)) {
pPropertyInfo[0].bstrValue = _errorText;
pPropertyInfo[0].dwFields |= enum_DEBUGPROP_INFO_FLAGS.DEBUGPROP_INFO_VALUE;
}
return VSConstants.S_OK;
}
示例3: ConstructDebugPropertyInfo
/// <summary>
/// Construct a DEBUG_PROPERTY_INFO representing this local or parameter.
/// </summary>
/// <param name="dwFields"></param>
/// <param name="dwRadix"></param>
/// <returns></returns>
internal override DEBUG_PROPERTY_INFO ConstructDebugPropertyInfo(enum_DEBUGPROP_INFO_FLAGS dwFields, uint dwRadix)
{
var info = new DEBUG_PROPERTY_INFO();
if (dwFields.HasFlag(enum_DEBUGPROP_INFO_FLAGS.DEBUGPROP_INFO_FULLNAME))
{
/*var sb = new StringBuilder(m_variableInformation.m_name);
info.bstrFullName = sb.ToString();
info.dwFields = (enum_DEBUGPROP_INFO_FLAGS)((uint)info.dwFields | (uint)(DEBUGPROP_INFO_FLAGS.DEBUGPROP_INFO_FULLNAME));*/
}
if (dwFields.HasFlag(enum_DEBUGPROP_INFO_FLAGS.DEBUGPROP_INFO_NAME))
{
info.bstrName = "Length";
info.dwFields |= enum_DEBUGPROP_INFO_FLAGS.DEBUGPROP_INFO_NAME;
}
if (dwFields.HasFlag(enum_DEBUGPROP_INFO_FLAGS.DEBUGPROP_INFO_TYPE))
{
/*StringBuilder sb = new StringBuilder(m_variableInformation.m_typeName);
info.bstrType = sb.ToString();
info.dwFields = (enum_DEBUGPROP_INFO_FLAGS)((uint)info.dwFields | (uint)(DEBUGPROP_INFO_FLAGS.DEBUGPROP_INFO_TYPE));*/
}
if (dwFields.HasFlag(enum_DEBUGPROP_INFO_FLAGS.DEBUGPROP_INFO_VALUE))
{
info.bstrValue = length.ToString();
info.dwFields |= enum_DEBUGPROP_INFO_FLAGS.DEBUGPROP_INFO_VALUE;
}
if (dwFields.HasFlag(enum_DEBUGPROP_INFO_FLAGS.DEBUGPROP_INFO_ATTRIB))
{
// The sample does not support writing of values displayed in the debugger, so mark them all as read-only.
info.dwAttrib = enum_DBG_ATTRIB_FLAGS.DBG_ATTRIB_VALUE_READONLY;
info.dwFields |= enum_DEBUGPROP_INFO_FLAGS.DEBUGPROP_INFO_ATTRIB;
}
// If the debugger has asked for the property, or the property has children (meaning it is a pointer in the sample)
// then set the pProperty field so the debugger can call back when the chilren are enumerated.
if (dwFields.HasFlag(enum_DEBUGPROP_INFO_FLAGS.DEBUGPROP_INFO_PROP))
{
info.pProperty = this;
info.dwFields |= enum_DEBUGPROP_INFO_FLAGS.DEBUGPROP_INFO_PROP;
}
return info;
}
示例4: ConstructDebugPropertyInfo
/// <summary>
/// Construct a DEBUG_PROPERTY_INFO representing this local or parameter.
/// </summary>
/// <param name="dwFields"></param>
/// <param name="dwRadix"></param>
/// <returns></returns>
internal override DEBUG_PROPERTY_INFO ConstructDebugPropertyInfo(enum_DEBUGPROP_INFO_FLAGS dwFields, uint dwRadix)
{
var info = new DEBUG_PROPERTY_INFO();
if (dwFields.HasFlag(enum_DEBUGPROP_INFO_FLAGS.DEBUGPROP_INFO_FULLNAME))
{
info.bstrFullName = "$regs";
info.dwFields |= enum_DEBUGPROP_INFO_FLAGS.DEBUGPROP_INFO_FULLNAME;
}
if (dwFields.HasFlag(enum_DEBUGPROP_INFO_FLAGS.DEBUGPROP_INFO_NAME))
{
info.bstrName = "$regs";
info.dwFields |= enum_DEBUGPROP_INFO_FLAGS.DEBUGPROP_INFO_NAME;
}
if (dwFields.HasFlag(enum_DEBUGPROP_INFO_FLAGS.DEBUGPROP_INFO_VALUE))
{
info.bstrValue = "(local registers)";
info.dwFields |= enum_DEBUGPROP_INFO_FLAGS.DEBUGPROP_INFO_VALUE;
}
if (dwFields.HasFlag(enum_DEBUGPROP_INFO_FLAGS.DEBUGPROP_INFO_ATTRIB))
{
info.dwAttrib |= enum_DBG_ATTRIB_FLAGS.DBG_ATTRIB_OBJ_IS_EXPANDABLE;
info.dwAttrib |= enum_DBG_ATTRIB_FLAGS.DBG_ATTRIB_VALUE_READONLY;
info.dwFields |= enum_DEBUGPROP_INFO_FLAGS.DEBUGPROP_INFO_ATTRIB;
}
if (dwFields.HasFlag(enum_DEBUGPROP_INFO_FLAGS.DEBUGPROP_INFO_TYPE))
{
info.bstrType = "(local registers)";
info.dwFields = enum_DEBUGPROP_INFO_FLAGS.DEBUGPROP_INFO_TYPE;
}
if (dwFields.HasFlag(enum_DEBUGPROP_INFO_FLAGS.DEBUGPROP_INFO_PROP))
{
info.pProperty = this;
info.dwFields |= enum_DEBUGPROP_INFO_FLAGS.DEBUGPROP_INFO_PROP;
}
return info;
}
示例5: ConstructDebugPropertyInfo
/// <summary>
/// Construct a DEBUG_PROPERTY_INFO representing this local or parameter.
/// </summary>
/// <param name="dwFields"></param>
/// <param name="dwRadix"></param>
/// <returns></returns>
internal override DEBUG_PROPERTY_INFO ConstructDebugPropertyInfo(enum_DEBUGPROP_INFO_FLAGS dwFields, uint dwRadix)
{
var info = new DEBUG_PROPERTY_INFO();
if (dwFields.HasFlag(enum_DEBUGPROP_INFO_FLAGS.DEBUGPROP_INFO_FULLNAME))
{
info.bstrFullName = Name;
info.dwFields |= enum_DEBUGPROP_INFO_FLAGS.DEBUGPROP_INFO_FULLNAME;
/*var sb = new StringBuilder(m_variableInformation.m_name);
info.bstrFullName = sb.ToString();
info.dwFields = (enum_DEBUGPROP_INFO_FLAGS)((uint)info.dwFields | (uint)(DEBUGPROP_INFO_FLAGS.DEBUGPROP_INFO_FULLNAME));*/
}
if (dwFields.HasFlag(enum_DEBUGPROP_INFO_FLAGS.DEBUGPROP_INFO_NAME))
{
info.bstrName = Name;
info.dwFields |= enum_DEBUGPROP_INFO_FLAGS.DEBUGPROP_INFO_NAME;
}
if (dwFields.HasFlag(enum_DEBUGPROP_INFO_FLAGS.DEBUGPROP_INFO_TYPE))
{
info.bstrType = Type;
info.dwFields |= enum_DEBUGPROP_INFO_FLAGS.DEBUGPROP_INFO_TYPE;
}
if (dwFields.HasFlag(enum_DEBUGPROP_INFO_FLAGS.DEBUGPROP_INFO_VALUE))
{
info.bstrValue = Value;
info.dwFields |= enum_DEBUGPROP_INFO_FLAGS.DEBUGPROP_INFO_VALUE;
}
if (dwFields.HasFlag(enum_DEBUGPROP_INFO_FLAGS.DEBUGPROP_INFO_ATTRIB))
{
// all properties readonly by default.
info.dwAttrib = enum_DBG_ATTRIB_FLAGS.DBG_ATTRIB_VALUE_READONLY;
if (HasSideEffects)
info.dwAttrib |= enum_DBG_ATTRIB_FLAGS.DBG_ATTRIB_VALUE_SIDE_EFFECT;
info.dwFields |= enum_DEBUGPROP_INFO_FLAGS.DEBUGPROP_INFO_ATTRIB;
}
return info;
}
示例6: ConstructDebugPropertyInfo
// Construct a DEBUG_PROPERTY_INFO representing this local or parameter.
public DEBUG_PROPERTY_INFO ConstructDebugPropertyInfo(DIF dwFields)
{
var propertyInfo = new DEBUG_PROPERTY_INFO();
if (dwFields.HasFlag(DIF.DEBUGPROP_INFO_FULLNAME)) {
propertyInfo.bstrFullName = m_variableInformation.m_fullName;
propertyInfo.dwFields |= DIF.DEBUGPROP_INFO_FULLNAME;
}
if (dwFields.HasFlag(DIF.DEBUGPROP_INFO_NAME)) {
propertyInfo.bstrName = m_variableInformation.m_name;
propertyInfo.dwFields |= DIF.DEBUGPROP_INFO_NAME;
}
if (dwFields.HasFlag(DIF.DEBUGPROP_INFO_TYPE)) {
propertyInfo.bstrType = m_variableInformation.m_typeName;
propertyInfo.dwFields = DIF.DEBUGPROP_INFO_TYPE;
}
if (dwFields.HasFlag(DIF.DEBUGPROP_INFO_VALUE)) {
propertyInfo.bstrValue = m_variableInformation.m_value;
propertyInfo.dwFields = DIF.DEBUGPROP_INFO_VALUE;
}
if (dwFields.HasFlag(DIF.DEBUGPROP_INFO_ATTRIB)) {
// The sample does not support writing of values displayed in the debugger, so mark them all as read-only.
propertyInfo.dwAttrib = enum_DBG_ATTRIB_FLAGS.DBG_ATTRIB_VALUE_READONLY;
if (m_variableInformation.IsString)
propertyInfo.dwAttrib |= enum_DBG_ATTRIB_FLAGS.DBG_ATTRIB_VALUE_RAW_STRING;
if (m_variableInformation.HasChildren)
propertyInfo.dwAttrib |= enum_DBG_ATTRIB_FLAGS.DBG_ATTRIB_OBJ_IS_EXPANDABLE;
if (m_variableInformation.HasAccessor)
propertyInfo.dwAttrib |= enum_DBG_ATTRIB_FLAGS.DBG_ATTRIB_PROPERTY;
if (m_variableInformation.IsPrivate)
propertyInfo.dwAttrib |= enum_DBG_ATTRIB_FLAGS.DBG_ATTRIB_ACCESS_PRIVATE;
if (m_variableInformation.IsMethod)
propertyInfo.dwAttrib |= enum_DBG_ATTRIB_FLAGS.DBG_ATTRIB_METHOD;
//propertyInfo.dwAttrib |= enum_DBG_ATTRIB_FLAGS.DBG_ATTRIB_VALUE_SIDE_EFFECT;
propertyInfo.dwFields |= DIF.DEBUGPROP_INFO_ATTRIB;
}
// If the debugger has asked for the property, or the property has children (meaning it is a pointer in the sample)
// then set the pProperty field so the debugger can call back when the chilren are enumerated.
if ((dwFields.HasFlag(DIF.DEBUGPROP_INFO_PROP)) ||
(m_variableInformation.HasChildren)) {
propertyInfo.pProperty = this;
propertyInfo.dwFields |= DIF.DEBUGPROP_INFO_PROP;
}
return propertyInfo;
}
示例7: EnumChildren
// Enumerates the children of a property. This provides support for dereferencing pointers, displaying members of an array, or fields of a class or struct.
// The sample debugger only supports pointer dereferencing as children. This means there is only ever one child.
public int EnumChildren(enum_DEBUGPROP_INFO_FLAGS dwFields, uint dwRadix, ref Guid guidFilter, enum_DBG_ATTRIB_FLAGS dwAttribFilter, string pszNameFilter, uint dwTimeout, out IEnumDebugPropertyInfo2 ppEnum) {
TimeSpan timeout = TimeSpan.FromMilliseconds(dwTimeout);
var tokenSource = new CancellationTokenSource(timeout);
List<NodeEvaluationResult> children = _evaluationResult.GetChildrenAsync(tokenSource.Token)
.WaitAsync(timeout, tokenSource.Token).Result;
DEBUG_PROPERTY_INFO[] properties;
if (children == null || children.Count == 0) {
properties = new[] { new DEBUG_PROPERTY_INFO { dwFields = enum_DEBUGPROP_INFO_FLAGS.DEBUGPROP_INFO_NAME, bstrValue = "No children" } };
} else {
properties = new DEBUG_PROPERTY_INFO[children.Count];
for (int i = 0; i < children.Count; i++) {
properties[i] = new AD7Property(_frame, children[i], this).ConstructDebugPropertyInfo(dwRadix, dwFields);
}
}
if (dwFields.HasFlag(enum_DEBUGPROP_INFO_FLAGS.DEBUGPROP_INFO_NAME)) {
properties = properties.OrderBy(p => p.bstrName, _comparer).ToArray();
}
ppEnum = new AD7PropertyEnum(properties);
return VSConstants.S_OK;
}
示例8: ConstructDebugPropertyInfo
/// <summary>
/// Construct a DEBUG_PROPERTY_INFO representing this local or parameter.
/// </summary>
/// <param name="dwFields"></param>
/// <param name="dwRadix"></param>
/// <returns></returns>
internal override DEBUG_PROPERTY_INFO ConstructDebugPropertyInfo(enum_DEBUGPROP_INFO_FLAGS dwFields, uint dwRadix)
{
var info = new DEBUG_PROPERTY_INFO();
if (dwFields.HasFlag(enum_DEBUGPROP_INFO_FLAGS.DEBUGPROP_INFO_FULLNAME))
{
info.bstrFullName = Value.Name;
info.dwFields |= enum_DEBUGPROP_INFO_FLAGS.DEBUGPROP_INFO_FULLNAME;
/*var sb = new StringBuilder(m_variableInformation.m_name);
info.bstrFullName = sb.ToString();
info.dwFields = (enum_DEBUGPROP_INFO_FLAGS)((uint)info.dwFields | (uint)(DEBUGPROP_INFO_FLAGS.DEBUGPROP_INFO_FULLNAME));*/
}
if (dwFields.HasFlag(enum_DEBUGPROP_INFO_FLAGS.DEBUGPROP_INFO_NAME))
{
info.bstrName = Value.Name;
info.dwFields |= enum_DEBUGPROP_INFO_FLAGS.DEBUGPROP_INFO_NAME;
}
if (dwFields.HasFlag(enum_DEBUGPROP_INFO_FLAGS.DEBUGPROP_INFO_TYPE))
{
if (Value.IsPrimitive)
{
info.bstrType = Value.Value.GetType().Name;
}
else if (Value.IsString)
{
info.bstrType = typeof (string).Name;
}
else if (!Value.ObjectReference.IsNull)
{
info.bstrType = Value.ObjectReference.GetReferenceTypeAsync().Select(t => t.GetNameAsync()).Unwrap().Await(DalvikProcess.VmTimeout);
}
else
{
info.bstrType = typeof (object).Name;
}
info.dwFields |= enum_DEBUGPROP_INFO_FLAGS.DEBUGPROP_INFO_TYPE;
}
if (dwFields.HasFlag(enum_DEBUGPROP_INFO_FLAGS.DEBUGPROP_INFO_VALUE))
{
if (Value.IsString && !Value.ObjectReference.IsNull)
{
info.bstrValue = Value.ObjectReference.GetStringValueAsync().Await(DalvikProcess.VmTimeout);
}
else if (Value.IsArray && !Value.ObjectReference.IsNull)
{
info.bstrValue = "(array)";
}
else if (Value.Tag == Jdwp.Tag.ClassObject)
{
info.bstrValue = "{" + Value.ObjectReference.GetClassObjectNameAsync().Await(DalvikProcess.VmTimeout) + "}";
}
else
{
if(!Value.IsPrimitive || Value.IsBoolean)
info.bstrValue = Value.Value.ToString();
else
{
info.bstrValue = FormatPrimitive(Value, (int)dwRadix);
}
}
info.dwFields |= enum_DEBUGPROP_INFO_FLAGS.DEBUGPROP_INFO_VALUE;
}
if (dwFields.HasFlag(enum_DEBUGPROP_INFO_FLAGS.DEBUGPROP_INFO_ATTRIB))
{
// all properties readonly by default.
info.dwAttrib = enum_DBG_ATTRIB_FLAGS.DBG_ATTRIB_VALUE_READONLY;
if ((!Value.IsPrimitive) && (!Value.IsString) && (!Value.ObjectReference.IsNull))
{
// Objects can be expanded
info.dwAttrib |= enum_DBG_ATTRIB_FLAGS.DBG_ATTRIB_OBJ_IS_EXPANDABLE;
}
if (Value.IsBoolean)
{
info.dwAttrib |= enum_DBG_ATTRIB_FLAGS.DBG_ATTRIB_VALUE_BOOLEAN;
if (true.Equals(Value.Value))
info.dwAttrib |= enum_DBG_ATTRIB_FLAGS.DBG_ATTRIB_VALUE_BOOLEAN_TRUE;
} else if (Value.IsString)
{
info.dwAttrib |= enum_DBG_ATTRIB_FLAGS.DBG_ATTRIB_VALUE_RAW_STRING;
}
info.dwFields |= enum_DEBUGPROP_INFO_FLAGS.DEBUGPROP_INFO_ATTRIB;
}
// If the debugger has asked for the property, or the property has children (meaning it is a pointer in the sample)
// then set the pProperty field so the debugger can call back when the chilren are enumerated.
if (dwFields.HasFlag(enum_DEBUGPROP_INFO_FLAGS.DEBUGPROP_INFO_PROP) || (!Value.IsPrimitive))
{
info.pProperty = this;
//.........这里部分代码省略.........
示例9: GetDebugPropertyInfo
internal DEBUG_PROPERTY_INFO GetDebugPropertyInfo(uint radix, enum_DEBUGPROP_INFO_FLAGS fields) {
var dpi = new DEBUG_PROPERTY_INFO();
// Always provide the property so that we can access locals from the automation object.
dpi.pProperty = this;
dpi.dwFields |= enum_DEBUGPROP_INFO_FLAGS.DEBUGPROP_INFO_PROP;
var valueResult = EvaluationResult as DebugValueEvaluationResult;
var errorResult = EvaluationResult as DebugErrorEvaluationResult;
var promiseResult = EvaluationResult as DebugPromiseEvaluationResult;
if (fields.HasFlag(enum_DEBUGPROP_INFO_FLAGS.DEBUGPROP_INFO_FULLNAME)) {
dpi.bstrFullName = EvaluationResult.Expression;
dpi.dwFields |= enum_DEBUGPROP_INFO_FLAGS.DEBUGPROP_INFO_FULLNAME;
}
if (fields.HasFlag(enum_DEBUGPROP_INFO_FLAGS.DEBUGPROP_INFO_NAME)) {
dpi.bstrName = EvaluationResult.Name ?? EvaluationResult.Expression;
if (Parent?.IsFrameEnvironment == true && dpi.bstrName?.StartsWith("$") == true) {
dpi.bstrName = dpi.bstrName.Substring(1);
}
dpi.dwFields |= enum_DEBUGPROP_INFO_FLAGS.DEBUGPROP_INFO_NAME;
}
if (fields.HasFlag(enum_DEBUGPROP_INFO_FLAGS.DEBUGPROP_INFO_TYPE)) {
if (valueResult != null) {
dpi.bstrType = valueResult.TypeName;
if (valueResult.Classes != null && valueResult.Classes.Count > 0) {
dpi.bstrType += " (" + string.Join(", ", valueResult.Classes) + ")";
}
dpi.dwFields |= enum_DEBUGPROP_INFO_FLAGS.DEBUGPROP_INFO_TYPE;
} else if (promiseResult != null) {
dpi.bstrType = "<promise>";
dpi.dwFields |= enum_DEBUGPROP_INFO_FLAGS.DEBUGPROP_INFO_TYPE;
} else if (EvaluationResult is DebugActiveBindingEvaluationResult) {
dpi.bstrType = "<active binding>";
dpi.dwFields |= enum_DEBUGPROP_INFO_FLAGS.DEBUGPROP_INFO_TYPE;
}
}
if (fields.HasFlag(enum_DEBUGPROP_INFO_FLAGS.DEBUGPROP_INFO_VALUE)) {
if (valueResult != null) {
// TODO: handle radix
dpi.bstrValue = valueResult.GetRepresentation(DebugValueRepresentationKind.Raw).Deparse;
dpi.dwFields |= enum_DEBUGPROP_INFO_FLAGS.DEBUGPROP_INFO_VALUE;
} else if (promiseResult != null) {
dpi.bstrValue = promiseResult.Code;
dpi.dwFields |= enum_DEBUGPROP_INFO_FLAGS.DEBUGPROP_INFO_VALUE;
} else if (errorResult != null) {
dpi.bstrValue = errorResult.ErrorText;
dpi.dwFields |= enum_DEBUGPROP_INFO_FLAGS.DEBUGPROP_INFO_VALUE;
}
}
if (fields.HasFlag(enum_DEBUGPROP_INFO_FLAGS.DEBUGPROP_INFO_ATTRIB)) {
dpi.dwFields |= enum_DEBUGPROP_INFO_FLAGS.DEBUGPROP_INFO_ATTRIB;
if (IsSynthetic) {
dpi.dwAttrib |= enum_DBG_ATTRIB_FLAGS.DBG_ATTRIB_METHOD | enum_DBG_ATTRIB_FLAGS.DBG_ATTRIB_TYPE_VIRTUAL;
}
if (StackFrame.Engine.GridViewProvider?.CanShowDataGrid(EvaluationResult) == true) {
dpi.dwAttrib |= enum_DBG_ATTRIB_FLAGS.DBG_ATTRIB_VALUE_CUSTOM_VIEWER;
}
if (valueResult?.HasChildren == true || valueResult?.HasAttributes == true) {
dpi.dwAttrib |= enum_DBG_ATTRIB_FLAGS.DBG_ATTRIB_OBJ_IS_EXPANDABLE;
}
if (valueResult != null) {
switch (valueResult.TypeName) {
case "logical":
dpi.dwAttrib |= enum_DBG_ATTRIB_FLAGS.DBG_ATTRIB_VALUE_BOOLEAN;
if (valueResult.GetRepresentation(DebugValueRepresentationKind.Raw).Deparse == "TRUE") {
dpi.dwAttrib |= enum_DBG_ATTRIB_FLAGS.DBG_ATTRIB_VALUE_BOOLEAN_TRUE;
}
break;
case "closure":
dpi.dwAttrib |= enum_DBG_ATTRIB_FLAGS.DBG_ATTRIB_METHOD;
break;
case "character":
case "symbol":
if (valueResult.Length == 1) {
dpi.dwAttrib |= enum_DBG_ATTRIB_FLAGS.DBG_ATTRIB_VALUE_RAW_STRING;
}
break;
}
} else if (errorResult != null) {
dpi.dwAttrib |= enum_DBG_ATTRIB_FLAGS.DBG_ATTRIB_VALUE_ERROR;
} else if (promiseResult != null) {
dpi.dwAttrib |= enum_DBG_ATTRIB_FLAGS.DBG_ATTRIB_VALUE_SIDE_EFFECT;
} else if (EvaluationResult is DebugActiveBindingEvaluationResult) {
dpi.dwAttrib |= enum_DBG_ATTRIB_FLAGS.DBG_ATTRIB_PROPERTY;
dpi.dwAttrib |= enum_DBG_ATTRIB_FLAGS.DBG_ATTRIB_VALUE_SIDE_EFFECT;
}
}
return dpi;
}