Rename CharacterReplacement back to CharItem
Since the class is public renaming this would be a breaking change, since if anyone is directly referring to the class it would break
This commit is contained in:
@@ -1,6 +1,6 @@
|
||||
namespace Umbraco.Cms.Core.Configuration.UmbracoSettings
|
||||
namespace Umbraco.Cms.Core.Configuration.Models
|
||||
{
|
||||
public class CharacterReplacement
|
||||
public class CharItem
|
||||
{
|
||||
/// <summary>
|
||||
/// The character to replace
|
||||
@@ -19,7 +19,7 @@ namespace Umbraco.Cms.Core.Configuration.Models
|
||||
internal const string StaticConvertUrlsToAscii = "try";
|
||||
internal const bool StaticEnableDefaultCharReplacements = true;
|
||||
|
||||
internal static readonly CharacterReplacement[] DefaultCharCollection =
|
||||
internal static readonly CharItem[] DefaultCharCollection =
|
||||
{
|
||||
new () { Char = " ", Replacement = "-" },
|
||||
new () { Char = "\"", Replacement = string.Empty },
|
||||
@@ -78,13 +78,13 @@ namespace Umbraco.Cms.Core.Configuration.Models
|
||||
/// <summary>
|
||||
/// Add additional character replacements, or override defaults
|
||||
/// </summary>
|
||||
public CharacterReplacement[] CharCollection { get; set; }
|
||||
public CharItem[] CharCollection { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// Get concatenated user and default character replacements
|
||||
/// taking into account <see cref="EnableDefaultCharReplacements"/>
|
||||
/// </summary>
|
||||
public IEnumerable<CharacterReplacement> GetCharReplacements()
|
||||
public IEnumerable<CharItem> GetCharReplacements()
|
||||
{
|
||||
// TODO We need to special handle ":", as this character is special in keys
|
||||
|
||||
|
||||
@@ -1,10 +1,11 @@
|
||||
using System.Collections.Generic;
|
||||
using Umbraco.Cms.Core.Configuration.Models;
|
||||
|
||||
namespace Umbraco.Cms.Core.Configuration.UmbracoSettings
|
||||
{
|
||||
public class CharacterReplacementEqualityComparer : IEqualityComparer<CharacterReplacement>
|
||||
public class CharacterReplacementEqualityComparer : IEqualityComparer<CharItem>
|
||||
{
|
||||
public bool Equals(CharacterReplacement x, CharacterReplacement y)
|
||||
public bool Equals(CharItem x, CharItem y)
|
||||
{
|
||||
if (ReferenceEquals(x, y))
|
||||
{
|
||||
@@ -29,7 +30,7 @@ namespace Umbraco.Cms.Core.Configuration.UmbracoSettings
|
||||
return x.Char == y.Char && x.Replacement == y.Replacement;
|
||||
}
|
||||
|
||||
public int GetHashCode(CharacterReplacement obj)
|
||||
public int GetHashCode(CharItem obj)
|
||||
{
|
||||
unchecked
|
||||
{
|
||||
|
||||
@@ -20,7 +20,7 @@ namespace Umbraco.Cms.Tests.UnitTests.Umbraco.Core.ShortStringHelper
|
||||
{
|
||||
var requestHandlerSettings = new RequestHandlerSettings()
|
||||
{
|
||||
CharCollection = Array.Empty<CharacterReplacement>(),
|
||||
CharCollection = Array.Empty<CharItem>(),
|
||||
EnableDefaultCharReplacements = false,
|
||||
ConvertUrlsToAscii = "false"
|
||||
};
|
||||
@@ -47,7 +47,7 @@ namespace Umbraco.Cms.Tests.UnitTests.Umbraco.Core.ShortStringHelper
|
||||
{
|
||||
var requestHandlerSettings = new RequestHandlerSettings()
|
||||
{
|
||||
CharCollection = Array.Empty<CharacterReplacement>(),
|
||||
CharCollection = Array.Empty<CharItem>(),
|
||||
EnableDefaultCharReplacements = false,
|
||||
ConvertUrlsToAscii = "false"
|
||||
};
|
||||
@@ -342,7 +342,7 @@ namespace Umbraco.Cms.Tests.UnitTests.Umbraco.Core.ShortStringHelper
|
||||
{
|
||||
var requestHandlerSettings = new RequestHandlerSettings()
|
||||
{
|
||||
CharCollection = Array.Empty<CharacterReplacement>(),
|
||||
CharCollection = Array.Empty<CharItem>(),
|
||||
EnableDefaultCharReplacements = false,
|
||||
ConvertUrlsToAscii = "false"
|
||||
};
|
||||
|
||||
Reference in New Issue
Block a user