Adding [DebuggerDisplay] attribute to core published content classes to make debugging easier

This commit is contained in:
Dan Booth
2021-08-06 20:21:30 +01:00
parent 1dd75b9051
commit 56f0f6b3fe
7 changed files with 16 additions and 1 deletions

View File

@@ -1,5 +1,6 @@
using System;
using System.Collections.Generic;
using System.Diagnostics;
using System.Linq;
namespace Umbraco.Core.Models.PublishedContent
@@ -9,6 +10,7 @@ namespace Umbraco.Core.Models.PublishedContent
/// </summary>
/// <remarks>Instances of the <see cref="PublishedContentType"/> class are immutable, ie
/// if the content type changes, then a new class needs to be created.</remarks>
[DebuggerDisplay("{Alias}")]
public class PublishedContentType : IPublishedContentType2
{
private readonly IPublishedPropertyType[] _propertyTypes;

View File

@@ -1,5 +1,6 @@
using System;
using System.Collections.Generic;
using System.Diagnostics;
namespace Umbraco.Core.Models.PublishedContent
{
@@ -18,6 +19,7 @@ namespace Umbraco.Core.Models.PublishedContent
/// Provides an abstract base class for <c>IPublishedContent</c> implementations that
/// wrap and extend another <c>IPublishedContent</c>.
/// </summary>
[DebuggerDisplay("{Id}: {Name} ({ContentType?.Alias})")]
public abstract class PublishedContentWrapped : IPublishedContent
{
private readonly IPublishedContent _content;

View File

@@ -1,10 +1,12 @@
using System;
using System.Diagnostics;
namespace Umbraco.Core.Models.PublishedContent
{
/// <summary>
/// Contains culture specific values for <see cref="IPublishedContent"/>.
/// </summary>
[DebuggerDisplay("{Culture}")]
public class PublishedCultureInfo
{
/// <summary>

View File

@@ -1,4 +1,5 @@
using System;
using System.Diagnostics;
namespace Umbraco.Core.Models.PublishedContent
{
@@ -10,6 +11,7 @@ namespace Umbraco.Core.Models.PublishedContent
/// if the data type changes, then a new class needs to be created.</para>
/// <para>These instances should be created by an <see cref="IPublishedContentTypeFactory"/>.</para>
/// </remarks>
[DebuggerDisplay("{EditorAlias}")]
public class PublishedDataType
{
private readonly Lazy<object> _lazyConfiguration;

View File

@@ -1,4 +1,5 @@
using System;
using System.Diagnostics;
using Umbraco.Core.PropertyEditors;
namespace Umbraco.Core.Models.PublishedContent
@@ -7,6 +8,7 @@ namespace Umbraco.Core.Models.PublishedContent
/// Provides a base class for <c>IPublishedProperty</c> implementations which converts and caches
/// the value source to the actual value to use when rendering content.
/// </summary>
[DebuggerDisplay("{Alias} ({PropertyType?.EditorAlias})")]
internal abstract class PublishedPropertyBase : IPublishedProperty
{
/// <summary>

View File

@@ -1,4 +1,5 @@
using System;
using System.Diagnostics;
using System.Xml.Linq;
using System.Xml.XPath;
using Umbraco.Core.PropertyEditors;
@@ -10,6 +11,7 @@ namespace Umbraco.Core.Models.PublishedContent
/// </summary>
/// <remarks>Instances of the <see cref="PublishedPropertyType"/> class are immutable, ie
/// if the property type changes, then a new class needs to be created.</remarks>
[DebuggerDisplay("{Alias} ({EditorAlias})")]
public class PublishedPropertyType : IPublishedPropertyType
{
private readonly IPublishedModelFactory _publishedModelFactory;

View File

@@ -1,5 +1,8 @@
namespace Umbraco.Core.Models.PublishedContent
using System.Diagnostics;
namespace Umbraco.Core.Models.PublishedContent
{
[DebuggerDisplay("{Content?.Name} ({Score})")]
public class PublishedSearchResult
{
public PublishedSearchResult(IPublishedContent content, float score)