public DebuggerDisplayInfo WithDebuggerDisplayAttribute(DkmClrDebuggerDisplayAttribute attribute, DkmClrType attributeTarget)
        {
            var name        = Name;
            var value       = m_value;
            var simpleValue = m_simpleValue;
            var typeName    = TypeName;

            if (attribute.Name != null)
            {
                name = new DebuggerDisplayItemInfo(attribute.Name, attributeTarget);
            }

            // Favorites info takes priority for value and simple value
            if (!m_hasFavoritesInfo && attribute.Value != null)
            {
                value       = new DebuggerDisplayItemInfo(attribute.Value, attributeTarget);
                simpleValue = null;
            }

            if (attribute.TypeName != null)
            {
                typeName = new DebuggerDisplayItemInfo(attribute.TypeName, attributeTarget);
            }

            return(new DebuggerDisplayInfo(
                       targetType: m_targetType,
                       name: name,
                       value: value,
                       simpleValue: simpleValue,
                       typeName: typeName,
                       hasFavoritesInfo: m_hasFavoritesInfo));
        }
Exemple #2
0
 public DebuggerDisplayInfo(DkmClrType targetType, DkmClrDebuggerDisplayAttribute attribute)
 {
     TargetType = targetType;
     Attribute  = attribute;
 }