Compare commits
72 Commits
| Author | SHA1 | Date | |
|---|---|---|---|
| 15c02ce828 | |||
| 1fe02af841 | |||
| 7aca2e3217 | |||
| e9324055e9 | |||
| 00a121188a | |||
| dcf022ffaa | |||
| 408b00a737 | |||
| e571f51750 | |||
| 85eb44ecc3 | |||
| 489bb7f3e9 | |||
| ff71d89415 | |||
| cd93ebe7c1 | |||
| 917efc4d9a | |||
| 3f2dd88325 | |||
| d42b2492b7 | |||
| 98f3035b5c | |||
| dccee475f2 | |||
| 8bf90bae91 | |||
| 34648fc8aa | |||
| 5f76bb82cd | |||
| a0506622b4 | |||
| 1256512a1d | |||
| 46cb6e2329 | |||
| e58588801e | |||
| 185c453c00 | |||
| 152ba318bf | |||
| 708f4d89c7 | |||
| 57ff36452e | |||
| 2495df5573 | |||
| e0fd6fa8ee | |||
| 79e447239f | |||
| 74865740e0 | |||
| f8bc25a2dd | |||
| 4da063369d | |||
| facf13f6d5 | |||
| 98afb9a030 | |||
| f8462a739c | |||
| 837a7b506e | |||
| d576be3593 | |||
| 20282edba4 | |||
| 8fa3f8e06a | |||
| b85fc649ea | |||
| deefad4b89 | |||
| 888390d86b | |||
| 99d2509eaa | |||
| e0c0da802d | |||
| f238f37508 | |||
| 2e2a275ea4 | |||
| a13723cc7e | |||
| 30add94906 | |||
| e61cd0fbba | |||
| 69407caea8 | |||
| dd9cfa7abf | |||
| 9122bbdd45 | |||
| 295d2d73e3 | |||
| 709babc95b | |||
| cab1462d51 | |||
| cad3e8a635 | |||
| 9bac6a4074 | |||
| 49a38f2824 | |||
| e19cfe575b | |||
| c007757564 | |||
| 0b77f8c244 | |||
| f470c4cd3f | |||
| 651d48e5c8 | |||
| 1f70e67ac1 | |||
| 2ef03a2c24 | |||
| 04b319ecb2 | |||
| fb608d5131 | |||
| dff06bde30 | |||
| 30c1c76263 | |||
| 61cb7ac769 |
+1
-3
@@ -1,12 +1,10 @@
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.IO;
|
||||
using System.Linq;
|
||||
using System.Reflection;
|
||||
|
||||
namespace Umbraco.Core
|
||||
{
|
||||
internal static class AssemblyExtensions
|
||||
public static class AssemblyExtensions
|
||||
{
|
||||
/// <summary>
|
||||
/// Returns the file used to load the assembly
|
||||
@@ -21,7 +21,7 @@ namespace Umbraco.Core
|
||||
// been closed, the Semaphore system object is destroyed - so in any case
|
||||
// an iisreset should clean up everything
|
||||
//
|
||||
internal class AsyncLock
|
||||
public class AsyncLock
|
||||
{
|
||||
private readonly SemaphoreSlim _semaphore;
|
||||
private readonly Semaphore _semaphore2;
|
||||
+1
-1
@@ -25,7 +25,7 @@ namespace Umbraco.Core.Cache
|
||||
/// This is much better for performance when we're not running in a load balanced environment so we can refresh the cache
|
||||
/// against a already resolved object instead of looking the object back up by id.
|
||||
/// </remarks>
|
||||
interface ICacheRefresher<T> : ICacheRefresher
|
||||
public interface ICacheRefresher<T> : ICacheRefresher
|
||||
{
|
||||
void Refresh(T instance);
|
||||
void Remove(T instance);
|
||||
+1
-1
@@ -3,7 +3,7 @@
|
||||
/// <summary>
|
||||
/// A cache refresher that supports refreshing or removing cache based on a custom Json payload
|
||||
/// </summary>
|
||||
interface IJsonCacheRefresher : ICacheRefresher
|
||||
public interface IJsonCacheRefresher : ICacheRefresher
|
||||
{
|
||||
/// <summary>
|
||||
/// Refreshes, clears, etc... any cache based on the information provided in the json
|
||||
+1
-1
@@ -3,7 +3,7 @@
|
||||
/// <summary>
|
||||
/// A cache refresher that supports refreshing cache based on a custom payload
|
||||
/// </summary>
|
||||
interface IPayloadCacheRefresher<TPayload> : IJsonCacheRefresher
|
||||
public interface IPayloadCacheRefresher<TPayload> : IJsonCacheRefresher
|
||||
{
|
||||
/// <summary>
|
||||
/// Refreshes, clears, etc... any cache based on the information provided in the payload
|
||||
+1
-1
@@ -6,7 +6,7 @@ namespace Umbraco.Core.CodeAnnotations
|
||||
/// Attribute to add a Friendly Name string with an UmbracoObjectType enum value
|
||||
/// </summary>
|
||||
[AttributeUsage(AttributeTargets.All, AllowMultiple = false, Inherited = false)]
|
||||
internal class FriendlyNameAttribute : Attribute
|
||||
public class FriendlyNameAttribute : Attribute
|
||||
{
|
||||
/// <summary>
|
||||
/// friendly name value
|
||||
+1
-1
@@ -6,7 +6,7 @@ namespace Umbraco.Core.CodeAnnotations
|
||||
/// Attribute to associate a GUID string and Type with an UmbracoObjectType Enum value
|
||||
/// </summary>
|
||||
[AttributeUsage(AttributeTargets.Field, AllowMultiple = false, Inherited = false)]
|
||||
internal class UmbracoObjectTypeAttribute : Attribute
|
||||
public class UmbracoObjectTypeAttribute : Attribute
|
||||
{
|
||||
public UmbracoObjectTypeAttribute(string objectId)
|
||||
{
|
||||
+1
-1
@@ -3,7 +3,7 @@
|
||||
namespace Umbraco.Core.CodeAnnotations
|
||||
{
|
||||
[AttributeUsage(AttributeTargets.Field, AllowMultiple = false, Inherited = false)]
|
||||
internal class UmbracoUdiTypeAttribute : Attribute
|
||||
public class UmbracoUdiTypeAttribute : Attribute
|
||||
{
|
||||
public string UdiType { get; private set; }
|
||||
|
||||
+1
-1
@@ -5,7 +5,7 @@ namespace Umbraco.Core.Collections
|
||||
/// <summary>
|
||||
/// Represents a composite key of (Type, Type) for fast dictionaries.
|
||||
/// </summary>
|
||||
internal struct CompositeTypeTypeKey : IEquatable<CompositeTypeTypeKey>
|
||||
public struct CompositeTypeTypeKey : IEquatable<CompositeTypeTypeKey>
|
||||
{
|
||||
/// <summary>
|
||||
/// Initializes a new instance of the <see cref="CompositeTypeTypeKey"/> struct.
|
||||
+1
-1
@@ -10,7 +10,7 @@ namespace Umbraco.Core.Collections
|
||||
/// A List that can be deep cloned with deep cloned elements and can reset the collection's items dirty flags
|
||||
/// </summary>
|
||||
/// <typeparam name="T"></typeparam>
|
||||
internal class DeepCloneableList<T> : List<T>, IDeepCloneable, IRememberBeingDirty
|
||||
public class DeepCloneableList<T> : List<T>, IDeepCloneable, IRememberBeingDirty
|
||||
{
|
||||
private readonly ListCloneBehavior _listCloneBehavior;
|
||||
|
||||
+1
-1
@@ -1,6 +1,6 @@
|
||||
namespace Umbraco.Core.Collections
|
||||
{
|
||||
internal enum ListCloneBehavior
|
||||
public enum ListCloneBehavior
|
||||
{
|
||||
/// <summary>
|
||||
/// When set, DeepClone will clone the items one time and the result list behavior will be None
|
||||
+1
-1
@@ -7,7 +7,7 @@ namespace Umbraco.Core.Collections
|
||||
/// and is customizable to keep the newest or oldest equatable item
|
||||
/// </summary>
|
||||
/// <typeparam name="T"></typeparam>
|
||||
internal class OrderedHashSet<T> : KeyedCollection<T, T>
|
||||
public class OrderedHashSet<T> : KeyedCollection<T, T>
|
||||
{
|
||||
private readonly bool _keepOldest;
|
||||
|
||||
+2
-2
@@ -8,7 +8,7 @@ namespace Umbraco.Core.Collections
|
||||
/// </summary>
|
||||
/// <remarks>Types in the list are, or derive from, or implement, the base type.</remarks>
|
||||
/// <typeparam name="TBase">The base type.</typeparam>
|
||||
internal class TypeList<TBase>
|
||||
public class TypeList<TBase>
|
||||
{
|
||||
private readonly List<Type> _list = new List<Type>();
|
||||
|
||||
@@ -30,4 +30,4 @@ namespace Umbraco.Core.Collections
|
||||
return _list.Contains(type);
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
+3
-3
@@ -12,7 +12,7 @@ namespace Umbraco.Core.Composing
|
||||
/// A utility class for type checking, this provides internal caching so that calls to these methods will be faster
|
||||
/// than doing a manual type check in c#
|
||||
/// </summary>
|
||||
internal static class TypeHelper
|
||||
public static class TypeHelper
|
||||
{
|
||||
private static readonly ConcurrentDictionary<Tuple<Type, bool, bool, bool>, PropertyInfo[]> GetPropertiesCache
|
||||
= new ConcurrentDictionary<Tuple<Type, bool, bool, bool>, PropertyInfo[]>();
|
||||
@@ -25,7 +25,7 @@ namespace Umbraco.Core.Composing
|
||||
/// Based on a type we'll check if it is IEnumerable{T} (or similar) and if so we'll return a List{T}, this will also deal with array types and return List{T} for those too.
|
||||
/// If it cannot be done, null is returned.
|
||||
/// </summary>
|
||||
internal static IList CreateGenericEnumerableFromObject(object obj)
|
||||
public static IList CreateGenericEnumerableFromObject(object obj)
|
||||
{
|
||||
var type = obj.GetType();
|
||||
|
||||
@@ -323,7 +323,7 @@ namespace Umbraco.Core.Composing
|
||||
return MatchType(implementation, contract, new Dictionary<string, Type>());
|
||||
}
|
||||
|
||||
internal static bool MatchType(Type implementation, Type contract, IDictionary<string, Type> bindings, bool variance = true)
|
||||
public static bool MatchType(Type implementation, Type contract, IDictionary<string, Type> bindings, bool variance = true)
|
||||
{
|
||||
if (contract.IsGenericType)
|
||||
{
|
||||
-1
@@ -1,5 +1,4 @@
|
||||
using System.Collections.Generic;
|
||||
using Newtonsoft.Json.Linq;
|
||||
|
||||
namespace Umbraco.Core.Configuration.Grid
|
||||
{
|
||||
@@ -0,0 +1,10 @@
|
||||
namespace Umbraco.Core.Configuration
|
||||
{
|
||||
/// <summary>
|
||||
/// Represents an Umbraco configuration section which can be used to pass to UmbracoConfiguration.For{T}
|
||||
/// </summary>
|
||||
public interface IUmbracoConfigurationSection
|
||||
{
|
||||
|
||||
}
|
||||
}
|
||||
+1
-1
@@ -6,7 +6,7 @@ namespace Umbraco.Core
|
||||
/// <summary>
|
||||
/// Allows for converting string representations of 0 and 1 to boolean
|
||||
/// </summary>
|
||||
internal class CustomBooleanTypeConverter : BooleanConverter
|
||||
public class CustomBooleanTypeConverter : BooleanConverter
|
||||
{
|
||||
public override bool CanConvertFrom(ITypeDescriptorContext context, Type sourceType)
|
||||
{
|
||||
+1
-4
@@ -1,7 +1,4 @@
|
||||
using Newtonsoft.Json;
|
||||
using Umbraco.Core.Manifest;
|
||||
|
||||
namespace Umbraco.Core.Dashboards
|
||||
namespace Umbraco.Core.Dashboards
|
||||
{
|
||||
/// <summary>
|
||||
/// Represents an access rule.
|
||||
+3
-11
@@ -1,23 +1,15 @@
|
||||
using System;
|
||||
using System.Collections;
|
||||
using System.Collections.Concurrent;
|
||||
using System.Collections.Generic;
|
||||
using System.Data;
|
||||
using System.Linq;
|
||||
using System.Text;
|
||||
using System.Threading;
|
||||
|
||||
namespace Umbraco.Core
|
||||
{
|
||||
|
||||
|
||||
/// <summary>
|
||||
/// Static and extension methods for the DataTable object
|
||||
/// </summary>
|
||||
internal static class DataTableExtensions
|
||||
public static class DataTableExtensions
|
||||
{
|
||||
|
||||
|
||||
/// <summary>
|
||||
/// Creates a DataTable with the specified alias and columns and uses a callback to populate the headers.
|
||||
/// </summary>
|
||||
@@ -65,7 +57,7 @@ namespace Umbraco.Core
|
||||
/// <remarks>
|
||||
/// This is for legacy code, I didn't want to go creating custom classes for these
|
||||
/// </remarks>
|
||||
internal static List<System.Tuple<IEnumerable<KeyValuePair<string, object>>, IEnumerable<KeyValuePair<string, object>>>> CreateTableData()
|
||||
public static List<System.Tuple<IEnumerable<KeyValuePair<string, object>>, IEnumerable<KeyValuePair<string, object>>>> CreateTableData()
|
||||
{
|
||||
return new List<System.Tuple<IEnumerable<KeyValuePair<string, object>>, IEnumerable<KeyValuePair<string, object>>>>();
|
||||
}
|
||||
@@ -79,7 +71,7 @@ namespace Umbraco.Core
|
||||
/// <remarks>
|
||||
/// This is for legacy code, I didn't want to go creating custom classes for these
|
||||
/// </remarks>
|
||||
internal static void AddRowData(
|
||||
public static void AddRowData(
|
||||
List<System.Tuple<IEnumerable<KeyValuePair<string, object>>, IEnumerable<KeyValuePair<string, object>>>> rowData,
|
||||
IEnumerable<KeyValuePair<string, object>> standardVals,
|
||||
IEnumerable<KeyValuePair<string, object>> userVals)
|
||||
+1
-1
@@ -12,7 +12,7 @@ namespace Umbraco.Core
|
||||
///<summary>
|
||||
/// Extension methods for Dictionary & ConcurrentDictionary
|
||||
///</summary>
|
||||
internal static class DictionaryExtensions
|
||||
public static class DictionaryExtensions
|
||||
{
|
||||
|
||||
/// <summary>
|
||||
+1
-1
@@ -1,4 +1,4 @@
|
||||
namespace Umbraco.Core.Persistence.DatabaseModelDefinitions
|
||||
namespace Umbraco.Core
|
||||
{
|
||||
public enum Direction
|
||||
{
|
||||
+39
-1
@@ -1,7 +1,6 @@
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.Linq;
|
||||
using Umbraco.Core.Persistence.DatabaseModelDefinitions;
|
||||
|
||||
namespace Umbraco.Core
|
||||
{
|
||||
@@ -10,6 +9,45 @@ namespace Umbraco.Core
|
||||
///</summary>
|
||||
public static class EnumerableExtensions
|
||||
{
|
||||
// based upon the original Zip<T1, T2, TResult> method
|
||||
public static IEnumerable<TResult> Zip<T1, T2, T3, TResult>(this IEnumerable<T1> e1, IEnumerable<T2> e2, IEnumerable<T3> e3,
|
||||
Func<T1, T2, T3, TResult> resultSelector)
|
||||
{
|
||||
if (e1 == null) throw new ArgumentNullException("e1");
|
||||
if (e2 == null) throw new ArgumentNullException("e2");
|
||||
if (e3 == null) throw new ArgumentNullException("e3");
|
||||
if (resultSelector == null) throw new ArgumentNullException("resultSelector");
|
||||
return ZipIterator(e1, e2, e3, resultSelector);
|
||||
}
|
||||
|
||||
private static IEnumerable<TResult> ZipIterator<T1, T2, T3, TResult>(IEnumerable<T1> ie1, IEnumerable<T2> ie2, IEnumerable<T3> ie3,
|
||||
Func<T1, T2, T3, TResult> resultSelector)
|
||||
{
|
||||
var e1 = ie1.GetEnumerator();
|
||||
try
|
||||
{
|
||||
var e2 = ie2.GetEnumerator();
|
||||
var e3 = ie3.GetEnumerator();
|
||||
try
|
||||
{
|
||||
while (e1.MoveNext() && e2.MoveNext() && e3.MoveNext())
|
||||
yield return resultSelector(e1.Current, e2.Current, e3.Current);
|
||||
}
|
||||
finally
|
||||
{
|
||||
if (e2 != null)
|
||||
e2.Dispose();
|
||||
if (e3 != null)
|
||||
e3.Dispose();
|
||||
}
|
||||
}
|
||||
finally
|
||||
{
|
||||
if (e1 != null)
|
||||
e1.Dispose();
|
||||
}
|
||||
}
|
||||
|
||||
internal static bool HasDuplicates<T>(this IEnumerable<T> items, bool includeNull)
|
||||
{
|
||||
var hs = new HashSet<T>();
|
||||
+2
-2
@@ -96,7 +96,7 @@ namespace Umbraco.Core.Events
|
||||
/// This allows for a bit of flexibility in our event raising - it's not pretty but we need to maintain backwards compatibility
|
||||
/// so we cannot change the strongly typed nature for some events.
|
||||
/// </remarks>
|
||||
public ReadOnlyDictionary<string, object> AdditionalData { get; internal set; }
|
||||
public ReadOnlyDictionary<string, object> AdditionalData { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// This can be used by event subscribers to store state in the event args so they easily deal with custom state data between a starting ("ing")
|
||||
@@ -105,7 +105,7 @@ namespace Umbraco.Core.Events
|
||||
public IDictionary<string, object> EventState
|
||||
{
|
||||
get => _eventState ?? (_eventState = new Dictionary<string, object>());
|
||||
internal set => _eventState = value;
|
||||
set => _eventState = value;
|
||||
}
|
||||
|
||||
public bool Equals(CancellableEventArgs other)
|
||||
+1
-1
@@ -41,6 +41,6 @@ namespace Umbraco.Core.Events
|
||||
/// <remarks>
|
||||
/// This is protected so that inheritors can expose it with their own name
|
||||
/// </remarks>
|
||||
internal object EventObject { get; set; }
|
||||
public object EventObject { get; set; }
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,4 @@
|
||||
namespace Umbraco.Core.Events
|
||||
{
|
||||
public class DatabaseCreationEventArgs : System.ComponentModel.CancelEventArgs{}
|
||||
}
|
||||
+3
-3
@@ -2,7 +2,7 @@
|
||||
|
||||
namespace Umbraco.Core.Events
|
||||
{
|
||||
internal class EventDefinition : EventDefinitionBase
|
||||
public class EventDefinition : EventDefinitionBase
|
||||
{
|
||||
private readonly EventHandler _trackedEvent;
|
||||
private readonly object _sender;
|
||||
@@ -25,7 +25,7 @@ namespace Umbraco.Core.Events
|
||||
}
|
||||
}
|
||||
|
||||
internal class EventDefinition<TEventArgs> : EventDefinitionBase
|
||||
public class EventDefinition<TEventArgs> : EventDefinitionBase
|
||||
{
|
||||
private readonly EventHandler<TEventArgs> _trackedEvent;
|
||||
private readonly object _sender;
|
||||
@@ -48,7 +48,7 @@ namespace Umbraco.Core.Events
|
||||
}
|
||||
}
|
||||
|
||||
internal class EventDefinition<TSender, TEventArgs> : EventDefinitionBase
|
||||
public class EventDefinition<TSender, TEventArgs> : EventDefinitionBase
|
||||
{
|
||||
private readonly TypedEventHandler<TSender, TEventArgs> _trackedEvent;
|
||||
private readonly TSender _sender;
|
||||
+1
-1
@@ -22,6 +22,6 @@
|
||||
/// <summary>
|
||||
/// This is used to track if this message should be used as a default message so that Umbraco doesn't also append it's own default messages
|
||||
/// </summary>
|
||||
internal bool IsDefaultEventMessage { get; set; }
|
||||
public bool IsDefaultEventMessage { get; set; }
|
||||
}
|
||||
}
|
||||
+4
-4
@@ -20,7 +20,7 @@ namespace Umbraco.Core.Events
|
||||
///
|
||||
/// We can also write tests to validate these are all working correctly for all services.
|
||||
/// </summary>
|
||||
internal class EventNameExtractor
|
||||
public class EventNameExtractor
|
||||
{
|
||||
|
||||
/// <summary>
|
||||
@@ -52,7 +52,7 @@ namespace Umbraco.Core.Events
|
||||
}
|
||||
}
|
||||
|
||||
internal static string[] FindEvents(Type senderType, Type argsType, Func<string, bool> exclude)
|
||||
public static string[] FindEvents(Type senderType, Type argsType, Func<string, bool> exclude)
|
||||
{
|
||||
var found = MatchedEventNames.GetOrAdd(new Tuple<Type, Type>(senderType, argsType), tuple =>
|
||||
{
|
||||
@@ -120,7 +120,7 @@ namespace Umbraco.Core.Events
|
||||
/// </summary>
|
||||
/// <param name="eventName"></param>
|
||||
/// <returns></returns>
|
||||
internal static bool MatchIngNames(string eventName)
|
||||
public static bool MatchIngNames(string eventName)
|
||||
{
|
||||
var splitter = new Regex(@"(?<!^)(?=[A-Z])");
|
||||
var words = splitter.Split(eventName);
|
||||
@@ -134,7 +134,7 @@ namespace Umbraco.Core.Events
|
||||
/// </summary>
|
||||
/// <param name="eventName"></param>
|
||||
/// <returns></returns>
|
||||
internal static bool MatchNonIngNames(string eventName)
|
||||
public static bool MatchNonIngNames(string eventName)
|
||||
{
|
||||
var splitter = new Regex(@"(?<!^)(?=[A-Z])");
|
||||
var words = splitter.Split(eventName);
|
||||
+1
-1
@@ -1,6 +1,6 @@
|
||||
namespace Umbraco.Core.Events
|
||||
{
|
||||
internal enum EventNameExtractorError
|
||||
public enum EventNameExtractorError
|
||||
{
|
||||
NoneFound,
|
||||
Ambiguous
|
||||
+1
-1
@@ -1,6 +1,6 @@
|
||||
namespace Umbraco.Core.Events
|
||||
{
|
||||
internal class EventNameExtractorResult
|
||||
public class EventNameExtractorResult
|
||||
{
|
||||
public EventNameExtractorError? Error { get; private set; }
|
||||
public string Name { get; private set; }
|
||||
+1
-1
@@ -2,7 +2,7 @@
|
||||
|
||||
namespace Umbraco.Core.Events
|
||||
{
|
||||
internal interface IDeletingMediaFilesEventArgs
|
||||
public interface IDeletingMediaFilesEventArgs
|
||||
{
|
||||
List<string> MediaFilesToDelete { get; }
|
||||
}
|
||||
+1
-1
@@ -3,7 +3,7 @@ using System.Net.Mail;
|
||||
|
||||
namespace Umbraco.Core.Events
|
||||
{
|
||||
internal class SendEmailEventArgs : EventArgs
|
||||
public class SendEmailEventArgs : EventArgs
|
||||
{
|
||||
public MailMessage Message { get; private set; }
|
||||
|
||||
Some files were not shown because too many files have changed in this diff Show More
Reference in New Issue
Block a user