Пример #1
0
        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));
        }
Пример #2
0
        public DebuggerDisplayInfo WithFavoritesInfo(DkmClrObjectFavoritesInfo favoritesInfo)
        {
            var value       = m_value;
            var simpleValue = m_simpleValue;

            if (favoritesInfo.DisplayString != null)
            {
                value       = new DebuggerDisplayItemInfo(favoritesInfo.DisplayString, m_targetType);
                simpleValue =
                    favoritesInfo.SimpleDisplayString != null
                        ? new DebuggerDisplayItemInfo(
                        favoritesInfo.SimpleDisplayString,
                        m_targetType
                        )
                        : null;
            }

            return(new DebuggerDisplayInfo(
                       targetType: m_targetType,
                       name: Name,
                       value: value,
                       simpleValue: simpleValue,
                       typeName: TypeName,
                       hasFavoritesInfo: true
                       ));
        }
Пример #3
0
 private DebuggerDisplayInfo(
     DkmClrType targetType,
     DebuggerDisplayItemInfo name,
     DebuggerDisplayItemInfo value,
     DebuggerDisplayItemInfo simpleValue,
     DebuggerDisplayItemInfo typeName,
     bool hasFavoritesInfo)
     : this(targetType)
 {
     Name               = name;
     m_value            = value;
     m_simpleValue      = simpleValue;
     TypeName           = typeName;
     m_hasFavoritesInfo = hasFavoritesInfo;
 }