Moves more utilities

This commit is contained in:
Shannon
2019-05-20 18:40:13 +02:00
parent a0506622b4
commit d42b2492b7
6 changed files with 13 additions and 18 deletions

View File

@@ -12,7 +12,7 @@ namespace Umbraco.Core
///<summary>
/// Extension methods for Dictionary & ConcurrentDictionary
///</summary>
internal static class DictionaryExtensions
public static class DictionaryExtensions
{
/// <summary>

View File

@@ -5,7 +5,7 @@ namespace Umbraco.Core
/// <summary>
/// Borrowed from http://stackoverflow.com/a/2575444/694494
/// </summary>
internal static class HashCodeHelper
public static class HashCodeHelper
{
public static int GetHashCode<T1, T2>(T1 arg1, T2 arg2)
{

View File

@@ -14,7 +14,7 @@ namespace Umbraco.Core
/// This will use the crypto libs to generate the hash and will try to ensure that
/// strings, etc... are not re-allocated so it's not consuming much memory.
/// </remarks>
internal class HashGenerator : DisposableObjectSlim
public class HashGenerator : DisposableObjectSlim
{
public HashGenerator()
{
@@ -24,33 +24,33 @@ namespace Umbraco.Core
private readonly MemoryStream _ms = new MemoryStream();
private StreamWriter _writer;
internal void AddInt(int i)
public void AddInt(int i)
{
_writer.Write(i);
}
internal void AddLong(long i)
public void AddLong(long i)
{
_writer.Write(i);
}
internal void AddObject(object o)
public void AddObject(object o)
{
_writer.Write(o);
}
internal void AddDateTime(DateTime d)
public void AddDateTime(DateTime d)
{
_writer.Write(d.Ticks);;
}
internal void AddString(string s)
public void AddString(string s)
{
if (s != null)
_writer.Write(s);
}
internal void AddCaseInsensitiveString(string s)
public void AddCaseInsensitiveString(string s)
{
//I've tried to no allocate a new string with this which can be done if we use the CompareInfo.GetSortKey method which will create a new
//byte array that we can use to write to the output, however this also allocates new objects so i really don't think the performance
@@ -63,7 +63,7 @@ namespace Umbraco.Core
_writer.Write(s.ToUpperInvariant());
}
internal void AddFileSystemItem(FileSystemInfo f)
public void AddFileSystemItem(FileSystemInfo f)
{
//if it doesn't exist, don't proceed.
if (f.Exists == false)
@@ -94,12 +94,12 @@ namespace Umbraco.Core
}
}
internal void AddFile(FileInfo f)
public void AddFile(FileInfo f)
{
AddFileSystemItem(f);
}
internal void AddFolder(DirectoryInfo d)
public void AddFolder(DirectoryInfo d)
{
AddFileSystemItem(d);
}
@@ -108,7 +108,7 @@ namespace Umbraco.Core
/// Returns the generated hash output of all added objects
/// </summary>
/// <returns></returns>
internal string GenerateHash()
public string GenerateHash()
{
//flush,close,dispose the writer,then create a new one since it's possible to keep adding after GenerateHash is called.

View File

@@ -307,7 +307,6 @@
<Compile Include="RegisterExtensions.cs" />
<Compile Include="ContentVariationExtensions.cs" />
<Compile Include="Deploy\IDataTypeConfigurationConnector.cs" />
<Compile Include="EnumExtensions.cs" />
<Compile Include="Events\CancellableEnumerableObjectEventArgs.cs" />
<Compile Include="Events\CancellableObjectEventArgsOfTEventObject.cs" />
<Compile Include="Events\ContentPublishedEventArgs.cs" />
@@ -445,7 +444,6 @@
<Compile Include="Models\PublishedContent\ThreadCultureVariationContextAccessor.cs" />
<Compile Include="Models\PublishedContent\VariationContextAccessorExtensions.cs" />
<Compile Include="Models\SimpleContentType.cs" />
<Compile Include="Models\Sections\ISection.cs" />
<Compile Include="PackageActions\AllowDoctype.cs" />
<Compile Include="PackageActions\PublishRootDocument.cs" />
<Compile Include="Packaging\CompiledPackageXmlParser.cs" />
@@ -545,7 +543,6 @@
<Compile Include="Deploy\IUniqueIdentifyingServiceConnector.cs" />
<Compile Include="Deploy\IValueConnector.cs" />
<Compile Include="Diagnostics\MiniDump.cs" />
<Compile Include="DictionaryExtensions.cs" />
<Compile Include="Dictionary\ICultureDictionary.cs" />
<Compile Include="Dictionary\ICultureDictionaryFactory.cs" />
<Compile Include="EmailSender.cs" />
@@ -595,8 +592,6 @@
<Compile Include="ExpressionExtensions.cs" />
<Compile Include="FileResources\Files.Designer.cs" />
<Compile Include="GuidUdi.cs" />
<Compile Include="HashCodeHelper.cs" />
<Compile Include="HashGenerator.cs" />
<Compile Include="HttpContextExtensions.cs" />
<Compile Include="IDisposeOnRequestEnd.cs" />
<Compile Include="IntExtensions.cs" />