diff --git a/src/Umbraco.Core/Attempt{T}.cs b/src/Umbraco.Core/Attempt{T}.cs
index 4a348247d4..3a6c52f840 100644
--- a/src/Umbraco.Core/Attempt{T}.cs
+++ b/src/Umbraco.Core/Attempt{T}.cs
@@ -1,164 +1,164 @@
-using System;
-using Umbraco.Core.Dynamics;
-
-namespace Umbraco.Core
-{
- ///
- /// Represents the result of an operation attempt.
- ///
- /// The type of the attempted operation result.
- [Serializable]
- public struct Attempt
- {
- private readonly bool _success;
- private readonly T _result;
- private readonly Exception _exception;
-
- ///
- /// Gets a value indicating whether this was successful.
- ///
- public bool Success
- {
- get { return _success; }
- }
-
- ///
- /// Gets the exception associated with an unsuccessful attempt.
- ///
- public Exception Exception { get { return _exception; } }
-
- ///
- /// Gets the exception associated with an unsuccessful attempt.
- ///
- /// Keep it for backward compatibility sake.
- [Obsolete(".Error is obsolete, you should use .Exception instead.", false)]
- public Exception Error { get { return _exception; } }
-
- ///
- /// Gets the attempt result.
- ///
- public T Result
- {
- get { return _result; }
- }
-
- // optimize, use a singleton failed attempt
- private static readonly Attempt Failed = new Attempt(false, default(T), null);
-
- ///
- /// Represents an unsuccessful attempt.
- ///
- /// Keep it for backward compatibility sake.
- [Obsolete(".Failed is obsolete, you should use Attempt.Fail() instead.", false)]
- public static readonly Attempt False = Failed;
-
- // private - use Succeed() or Fail() methods to create attempts
- private Attempt(bool success, T result, Exception exception)
- {
- _success = success;
- _result = result;
- _exception = exception;
- }
-
- ///
- /// Initialize a new instance of the struct with a result.
- ///
- /// A value indicating whether the attempt is successful.
- /// The result of the attempt.
- /// Keep it for backward compatibility sake.
- [Obsolete("Attempt ctors are obsolete, you should use Attempt.Succeed(), Attempt.Fail() or Attempt.If() instead.", false)]
- public Attempt(bool success, T result)
- : this(success, result, null)
- { }
-
- ///
- /// Initialize a new instance of the struct representing a failed attempt, with an exception.
- ///
- /// The exception causing the failure of the attempt.
- /// Keep it for backward compatibility sake.
- [Obsolete("Attempt ctors are obsolete, you should use Attempt.Succeed(), Attempt.Fail() or Attempt.If() instead.", false)]
- public Attempt(Exception exception)
- : this(false, default(T), exception)
- { }
-
- ///
- /// Creates a successful attempt.
- ///
- /// The successful attempt.
- public static Attempt Succeed()
- {
- return new Attempt(true, default(T), null);
- }
-
- ///
- /// Creates a successful attempt with a result.
- ///
- /// The result of the attempt.
- /// The successful attempt.
- public static Attempt Succeed(T result)
- {
- return new Attempt(true, result, null);
- }
-
- ///
- /// Creates a failed attempt.
- ///
- /// The failed attempt.
- public static Attempt Fail()
- {
- return Failed;
- }
-
- ///
- /// Creates a failed attempt with an exception.
- ///
- /// The exception causing the failure of the attempt.
- /// The failed attempt.
- public static Attempt Fail(Exception exception)
- {
- return new Attempt(false, default(T), exception);
- }
-
- ///
- /// Creates a failed attempt with a result.
- ///
- /// The result of the attempt.
- /// The failed attempt.
- public static Attempt Fail(T result)
- {
- return new Attempt(false, result, null);
- }
-
- ///
- /// Creates a failed attempt with a result and an exception.
- ///
- /// The result of the attempt.
- /// The exception causing the failure of the attempt.
- /// The failed attempt.
- public static Attempt Fail(T result, Exception exception)
- {
- return new Attempt(false, result, exception);
- }
-
- ///
- /// Creates a successful or a failed attempt.
- ///
- /// A value indicating whether the attempt is successful.
- /// The attempt.
- public static Attempt SucceedIf(bool condition)
- {
- return condition ? new Attempt(true, default(T), null) : Failed;
- }
-
- ///
- /// Creates a successful or a failed attempt, with a result.
- ///
- /// A value indicating whether the attempt is successful.
- /// The result of the attempt.
- /// The attempt.
- public static Attempt SucceedIf(bool condition, T result)
- {
- return new Attempt(condition, result, null);
- }
- }
+using System;
+using Umbraco.Core.Dynamics;
+
+namespace Umbraco.Core
+{
+ ///
+ /// Represents the result of an operation attempt.
+ ///
+ /// The type of the attempted operation result.
+ [Serializable]
+ public struct Attempt
+ {
+ private readonly bool _success;
+ private readonly T _result;
+ private readonly Exception _exception;
+
+ ///
+ /// Gets a value indicating whether this was successful.
+ ///
+ public bool Success
+ {
+ get { return _success; }
+ }
+
+ ///
+ /// Gets the exception associated with an unsuccessful attempt.
+ ///
+ public Exception Exception { get { return _exception; } }
+
+ ///
+ /// Gets the exception associated with an unsuccessful attempt.
+ ///
+ /// Keep it for backward compatibility sake.
+ [Obsolete(".Error is obsolete, you should use .Exception instead.", false)]
+ public Exception Error { get { return _exception; } }
+
+ ///
+ /// Gets the attempt result.
+ ///
+ public T Result
+ {
+ get { return _result; }
+ }
+
+ // optimize, use a singleton failed attempt
+ private static readonly Attempt Failed = new Attempt(false, default(T), null);
+
+ ///
+ /// Represents an unsuccessful attempt.
+ ///
+ /// Keep it for backward compatibility sake.
+ [Obsolete(".Failed is obsolete, you should use Attempt.Fail() instead.", false)]
+ public static readonly Attempt False = Failed;
+
+ // private - use Succeed() or Fail() methods to create attempts
+ private Attempt(bool success, T result, Exception exception)
+ {
+ _success = success;
+ _result = result;
+ _exception = exception;
+ }
+
+ ///
+ /// Initialize a new instance of the struct with a result.
+ ///
+ /// A value indicating whether the attempt is successful.
+ /// The result of the attempt.
+ /// Keep it for backward compatibility sake.
+ [Obsolete("Attempt ctors are obsolete, you should use Attempt.Succeed(), Attempt.Fail() or Attempt.If() instead.", false)]
+ public Attempt(bool success, T result)
+ : this(success, result, null)
+ { }
+
+ ///
+ /// Initialize a new instance of the struct representing a failed attempt, with an exception.
+ ///
+ /// The exception causing the failure of the attempt.
+ /// Keep it for backward compatibility sake.
+ [Obsolete("Attempt ctors are obsolete, you should use Attempt.Succeed(), Attempt.Fail() or Attempt.If() instead.", false)]
+ public Attempt(Exception exception)
+ : this(false, default(T), exception)
+ { }
+
+ ///
+ /// Creates a successful attempt.
+ ///
+ /// The successful attempt.
+ public static Attempt Succeed()
+ {
+ return new Attempt(true, default(T), null);
+ }
+
+ ///
+ /// Creates a successful attempt with a result.
+ ///
+ /// The result of the attempt.
+ /// The successful attempt.
+ public static Attempt Succeed(T result)
+ {
+ return new Attempt(true, result, null);
+ }
+
+ ///
+ /// Creates a failed attempt.
+ ///
+ /// The failed attempt.
+ public static Attempt Fail()
+ {
+ return Failed;
+ }
+
+ ///
+ /// Creates a failed attempt with an exception.
+ ///
+ /// The exception causing the failure of the attempt.
+ /// The failed attempt.
+ public static Attempt Fail(Exception exception)
+ {
+ return new Attempt(false, default(T), exception);
+ }
+
+ ///
+ /// Creates a failed attempt with a result.
+ ///
+ /// The result of the attempt.
+ /// The failed attempt.
+ public static Attempt Fail(T result)
+ {
+ return new Attempt(false, result, null);
+ }
+
+ ///
+ /// Creates a failed attempt with a result and an exception.
+ ///
+ /// The result of the attempt.
+ /// The exception causing the failure of the attempt.
+ /// The failed attempt.
+ public static Attempt Fail(T result, Exception exception)
+ {
+ return new Attempt(false, result, exception);
+ }
+
+ ///
+ /// Creates a successful or a failed attempt.
+ ///
+ /// A value indicating whether the attempt is successful.
+ /// The attempt.
+ public static Attempt SucceedIf(bool condition)
+ {
+ return condition ? new Attempt(true, default(T), null) : Failed;
+ }
+
+ ///
+ /// Creates a successful or a failed attempt, with a result.
+ ///
+ /// A value indicating whether the attempt is successful.
+ /// The result of the attempt.
+ /// The attempt.
+ public static Attempt SucceedIf(bool condition, T result)
+ {
+ return new Attempt(condition, result, null);
+ }
+ }
}
\ No newline at end of file
diff --git a/src/Umbraco.Core/Configuration/BaseRest/BaseRestSection.cs b/src/Umbraco.Core/Configuration/BaseRest/BaseRestSection.cs
index 24e7c12e03..271d07ddbb 100644
--- a/src/Umbraco.Core/Configuration/BaseRest/BaseRestSection.cs
+++ b/src/Umbraco.Core/Configuration/BaseRest/BaseRestSection.cs
@@ -1,38 +1,38 @@
-using System.Collections.Generic;
-using System.Configuration;
-
-namespace Umbraco.Core.Configuration.BaseRest
-{
-
- internal class BaseRestSection : UmbracoConfigurationSection, IBaseRestSection
- {
- private const string KeyEnabled = "enabled";
-
- private bool? _enabled;
-
- [ConfigurationProperty("", IsKey = false, IsRequired = false, IsDefaultCollection = true)]
- public ExtensionElementCollection Items
- {
- get { return (ExtensionElementCollection)base[""]; }
- }
-
- ///
- /// Gets or sets a value indicating whether base rest extensions are enabled.
- ///
- [ConfigurationProperty(KeyEnabled, DefaultValue = true, IsRequired = false)]
- public bool Enabled
- {
- get
- {
- return _enabled ?? (IsPresent == false || (bool)this[KeyEnabled]);
- }
- internal set { _enabled = value; }
- }
-
- IExtensionsCollection IBaseRestSection.Items
- {
- get { return Items; }
- }
-
- }
-}
+using System.Collections.Generic;
+using System.Configuration;
+
+namespace Umbraco.Core.Configuration.BaseRest
+{
+
+ internal class BaseRestSection : UmbracoConfigurationSection, IBaseRestSection
+ {
+ private const string KeyEnabled = "enabled";
+
+ private bool? _enabled;
+
+ [ConfigurationProperty("", IsKey = false, IsRequired = false, IsDefaultCollection = true)]
+ public ExtensionElementCollection Items
+ {
+ get { return (ExtensionElementCollection)base[""]; }
+ }
+
+ ///
+ /// Gets or sets a value indicating whether base rest extensions are enabled.
+ ///
+ [ConfigurationProperty(KeyEnabled, DefaultValue = true, IsRequired = false)]
+ public bool Enabled
+ {
+ get
+ {
+ return _enabled ?? (IsPresent == false || (bool)this[KeyEnabled]);
+ }
+ internal set { _enabled = value; }
+ }
+
+ IExtensionsCollection IBaseRestSection.Items
+ {
+ get { return Items; }
+ }
+
+ }
+}
diff --git a/src/Umbraco.Core/Configuration/BaseRest/ExtensionElement.cs b/src/Umbraco.Core/Configuration/BaseRest/ExtensionElement.cs
index 9d59281b11..df785efc2b 100644
--- a/src/Umbraco.Core/Configuration/BaseRest/ExtensionElement.cs
+++ b/src/Umbraco.Core/Configuration/BaseRest/ExtensionElement.cs
@@ -1,81 +1,81 @@
-using System;
-using System.Collections.Generic;
-using System.Configuration;
-
-namespace Umbraco.Core.Configuration.BaseRest
-{
-
- [ConfigurationCollection(typeof(ExtensionElement), CollectionType = ConfigurationElementCollectionType.BasicMapAlternate)]
- internal class ExtensionElement : ConfigurationElementCollection, IEnumerable, IExtension
- {
- const string KeyAlias = "alias";
- const string KeyType = "type";
- const string KeyMethod = "method";
-
- [ConfigurationProperty(KeyAlias, IsKey = true, IsRequired = true)]
- public string Alias
- {
- get { return (string)base[KeyAlias]; }
- }
-
- [ConfigurationProperty(KeyType, IsKey = false, IsRequired = true)]
- public string Type
- {
- get { return (string)base[KeyType]; }
- }
-
- public override ConfigurationElementCollectionType CollectionType
- {
- get { return ConfigurationElementCollectionType.BasicMapAlternate; }
- }
-
- protected override string ElementName
- {
- get { return KeyMethod; }
- }
-
- protected override bool IsElementName(string elementName)
- {
- return elementName.Equals(KeyMethod, StringComparison.InvariantCultureIgnoreCase);
- }
-
- protected override ConfigurationElement CreateNewElement()
- {
- return new MethodElement();
- }
-
- protected override object GetElementKey(ConfigurationElement element)
- {
- return ((MethodElement)element).Name;
- }
-
- public override bool IsReadOnly()
- {
- return false;
- }
-
- new public MethodElement this[string index]
- {
- get { return (MethodElement)BaseGet(index); }
- }
-
- IEnumerator IEnumerable.GetEnumerator()
- {
- for (var i = 0; i < Count; i++)
- {
- yield return BaseGet(i) as IMethodSection;
- }
- }
-
- System.Collections.IEnumerator System.Collections.IEnumerable.GetEnumerator()
- {
- return GetEnumerator();
- }
-
- IMethodSection IExtension.this[string index]
- {
- get { return this[index]; }
- }
-
- }
-}
+using System;
+using System.Collections.Generic;
+using System.Configuration;
+
+namespace Umbraco.Core.Configuration.BaseRest
+{
+
+ [ConfigurationCollection(typeof(ExtensionElement), CollectionType = ConfigurationElementCollectionType.BasicMapAlternate)]
+ internal class ExtensionElement : ConfigurationElementCollection, IEnumerable, IExtension
+ {
+ const string KeyAlias = "alias";
+ const string KeyType = "type";
+ const string KeyMethod = "method";
+
+ [ConfigurationProperty(KeyAlias, IsKey = true, IsRequired = true)]
+ public string Alias
+ {
+ get { return (string)base[KeyAlias]; }
+ }
+
+ [ConfigurationProperty(KeyType, IsKey = false, IsRequired = true)]
+ public string Type
+ {
+ get { return (string)base[KeyType]; }
+ }
+
+ public override ConfigurationElementCollectionType CollectionType
+ {
+ get { return ConfigurationElementCollectionType.BasicMapAlternate; }
+ }
+
+ protected override string ElementName
+ {
+ get { return KeyMethod; }
+ }
+
+ protected override bool IsElementName(string elementName)
+ {
+ return elementName.Equals(KeyMethod, StringComparison.InvariantCultureIgnoreCase);
+ }
+
+ protected override ConfigurationElement CreateNewElement()
+ {
+ return new MethodElement();
+ }
+
+ protected override object GetElementKey(ConfigurationElement element)
+ {
+ return ((MethodElement)element).Name;
+ }
+
+ public override bool IsReadOnly()
+ {
+ return false;
+ }
+
+ new public MethodElement this[string index]
+ {
+ get { return (MethodElement)BaseGet(index); }
+ }
+
+ IEnumerator IEnumerable.GetEnumerator()
+ {
+ for (var i = 0; i < Count; i++)
+ {
+ yield return BaseGet(i) as IMethodSection;
+ }
+ }
+
+ System.Collections.IEnumerator System.Collections.IEnumerable.GetEnumerator()
+ {
+ return GetEnumerator();
+ }
+
+ IMethodSection IExtension.this[string index]
+ {
+ get { return this[index]; }
+ }
+
+ }
+}
diff --git a/src/Umbraco.Core/Configuration/BaseRest/ExtensionElementCollection.cs b/src/Umbraco.Core/Configuration/BaseRest/ExtensionElementCollection.cs
index 0e9691606d..e941f1aa6d 100644
--- a/src/Umbraco.Core/Configuration/BaseRest/ExtensionElementCollection.cs
+++ b/src/Umbraco.Core/Configuration/BaseRest/ExtensionElementCollection.cs
@@ -1,70 +1,70 @@
-using System;
-using System.Collections.Generic;
-using System.Configuration;
-
-namespace Umbraco.Core.Configuration.BaseRest
-{
- public interface IExtensionsCollection : IEnumerable
- {
- IExtension this[string index] { get; }
- }
-
- [ConfigurationCollection(typeof(ExtensionElement), CollectionType = ConfigurationElementCollectionType.BasicMapAlternate)]
- internal class ExtensionElementCollection : ConfigurationElementCollection, IExtensionsCollection
- {
- const string KeyExtension = "extension";
-
- public override ConfigurationElementCollectionType CollectionType
- {
- get { return ConfigurationElementCollectionType.BasicMapAlternate; }
- }
-
- protected override string ElementName
- {
- get { return KeyExtension; }
- }
-
- protected override bool IsElementName(string elementName)
- {
- return elementName.Equals(KeyExtension, StringComparison.InvariantCultureIgnoreCase);
- }
-
- protected override ConfigurationElement CreateNewElement()
- {
- return new ExtensionElement();
- }
-
- protected override object GetElementKey(ConfigurationElement element)
- {
- return ((ExtensionElement)element).Alias;
- }
-
- public override bool IsReadOnly()
- {
- return false;
- }
-
- new public ExtensionElement this[string index]
- {
- get { return (ExtensionElement)BaseGet(index); }
- }
-
- IEnumerator IEnumerable.GetEnumerator()
- {
- for (var i = 0; i < Count; i++)
- {
- yield return BaseGet(i) as IExtension;
- }
- }
-
- System.Collections.IEnumerator System.Collections.IEnumerable.GetEnumerator()
- {
- return GetEnumerator();
- }
-
- IExtension IExtensionsCollection.this[string index]
- {
- get { return this[index]; }
- }
- }
-}
+using System;
+using System.Collections.Generic;
+using System.Configuration;
+
+namespace Umbraco.Core.Configuration.BaseRest
+{
+ public interface IExtensionsCollection : IEnumerable
+ {
+ IExtension this[string index] { get; }
+ }
+
+ [ConfigurationCollection(typeof(ExtensionElement), CollectionType = ConfigurationElementCollectionType.BasicMapAlternate)]
+ internal class ExtensionElementCollection : ConfigurationElementCollection, IExtensionsCollection
+ {
+ const string KeyExtension = "extension";
+
+ public override ConfigurationElementCollectionType CollectionType
+ {
+ get { return ConfigurationElementCollectionType.BasicMapAlternate; }
+ }
+
+ protected override string ElementName
+ {
+ get { return KeyExtension; }
+ }
+
+ protected override bool IsElementName(string elementName)
+ {
+ return elementName.Equals(KeyExtension, StringComparison.InvariantCultureIgnoreCase);
+ }
+
+ protected override ConfigurationElement CreateNewElement()
+ {
+ return new ExtensionElement();
+ }
+
+ protected override object GetElementKey(ConfigurationElement element)
+ {
+ return ((ExtensionElement)element).Alias;
+ }
+
+ public override bool IsReadOnly()
+ {
+ return false;
+ }
+
+ new public ExtensionElement this[string index]
+ {
+ get { return (ExtensionElement)BaseGet(index); }
+ }
+
+ IEnumerator IEnumerable.GetEnumerator()
+ {
+ for (var i = 0; i < Count; i++)
+ {
+ yield return BaseGet(i) as IExtension;
+ }
+ }
+
+ System.Collections.IEnumerator System.Collections.IEnumerable.GetEnumerator()
+ {
+ return GetEnumerator();
+ }
+
+ IExtension IExtensionsCollection.this[string index]
+ {
+ get { return this[index]; }
+ }
+ }
+}
diff --git a/src/Umbraco.Core/Configuration/BaseRest/IBaseRestSection.cs b/src/Umbraco.Core/Configuration/BaseRest/IBaseRestSection.cs
index ff661465eb..24808d6b24 100644
--- a/src/Umbraco.Core/Configuration/BaseRest/IBaseRestSection.cs
+++ b/src/Umbraco.Core/Configuration/BaseRest/IBaseRestSection.cs
@@ -1,14 +1,14 @@
-using System.Collections.Generic;
-
-namespace Umbraco.Core.Configuration.BaseRest
-{
- public interface IBaseRestSection
- {
- IExtensionsCollection Items { get; }
-
- ///
- /// Gets a value indicating whether base rest extensions are enabled.
- ///
- bool Enabled { get; }
- }
+using System.Collections.Generic;
+
+namespace Umbraco.Core.Configuration.BaseRest
+{
+ public interface IBaseRestSection
+ {
+ IExtensionsCollection Items { get; }
+
+ ///
+ /// Gets a value indicating whether base rest extensions are enabled.
+ ///
+ bool Enabled { get; }
+ }
}
\ No newline at end of file
diff --git a/src/Umbraco.Core/Configuration/BaseRest/IExtension.cs b/src/Umbraco.Core/Configuration/BaseRest/IExtension.cs
index a0657d8f25..912898290b 100644
--- a/src/Umbraco.Core/Configuration/BaseRest/IExtension.cs
+++ b/src/Umbraco.Core/Configuration/BaseRest/IExtension.cs
@@ -1,11 +1,11 @@
-namespace Umbraco.Core.Configuration.BaseRest
-{
- public interface IExtension
- {
- string Alias { get; }
-
- string Type { get; }
-
- IMethodSection this[string index] { get; }
- }
+namespace Umbraco.Core.Configuration.BaseRest
+{
+ public interface IExtension
+ {
+ string Alias { get; }
+
+ string Type { get; }
+
+ IMethodSection this[string index] { get; }
+ }
}
\ No newline at end of file
diff --git a/src/Umbraco.Core/Configuration/BaseRest/IMethodSection.cs b/src/Umbraco.Core/Configuration/BaseRest/IMethodSection.cs
index c226c34a60..2c2f63928c 100644
--- a/src/Umbraco.Core/Configuration/BaseRest/IMethodSection.cs
+++ b/src/Umbraco.Core/Configuration/BaseRest/IMethodSection.cs
@@ -1,17 +1,17 @@
-namespace Umbraco.Core.Configuration.BaseRest
-{
- public interface IMethodSection
- {
- string Name { get; }
-
- bool AllowAll { get; }
-
- string AllowGroup { get; }
-
- string AllowType { get; }
-
- string AllowMember { get; }
-
- bool ReturnXml { get; }
- }
+namespace Umbraco.Core.Configuration.BaseRest
+{
+ public interface IMethodSection
+ {
+ string Name { get; }
+
+ bool AllowAll { get; }
+
+ string AllowGroup { get; }
+
+ string AllowType { get; }
+
+ string AllowMember { get; }
+
+ bool ReturnXml { get; }
+ }
}
\ No newline at end of file
diff --git a/src/Umbraco.Core/Configuration/BaseRest/MethodElement.cs b/src/Umbraco.Core/Configuration/BaseRest/MethodElement.cs
index c52999b9ea..ab86fb2227 100644
--- a/src/Umbraco.Core/Configuration/BaseRest/MethodElement.cs
+++ b/src/Umbraco.Core/Configuration/BaseRest/MethodElement.cs
@@ -1,50 +1,50 @@
-using System.Configuration;
-
-namespace Umbraco.Core.Configuration.BaseRest
-{
- internal class MethodElement : ConfigurationElement, IMethodSection
- {
- const string KeyName = "name";
- const string KeyAllowAll = "allowAll";
- const string KeyAllowGroup = "allowGroup";
- const string KeyAllowType = "allowType";
- const string KeyAllowMember = "allowMember";
- const string KeyReturnXml = "returnXml";
-
- [ConfigurationProperty(KeyName, IsKey = true, IsRequired = true)]
- public string Name
- {
- get { return (string)base[KeyName]; }
- }
-
- [ConfigurationProperty(KeyAllowAll, IsKey = false, IsRequired = false, DefaultValue = false)]
- public bool AllowAll
- {
- get { return (bool)base[KeyAllowAll]; }
- }
-
- [ConfigurationProperty(KeyAllowGroup, IsKey = false, IsRequired = false, DefaultValue = null)]
- public string AllowGroup
- {
- get { return (string)base[KeyAllowGroup]; }
- }
-
- [ConfigurationProperty(KeyAllowType, IsKey = false, IsRequired = false, DefaultValue = null)]
- public string AllowType
- {
- get { return (string)base[KeyAllowType]; }
- }
-
- [ConfigurationProperty(KeyAllowMember, IsKey = false, IsRequired = false, DefaultValue = null)]
- public string AllowMember
- {
- get { return (string)base[KeyAllowMember]; }
- }
-
- [ConfigurationProperty(KeyReturnXml, IsKey = false, IsRequired = false, DefaultValue = true)]
- public bool ReturnXml
- {
- get { return (bool)base[KeyReturnXml]; }
- }
- }
-}
+using System.Configuration;
+
+namespace Umbraco.Core.Configuration.BaseRest
+{
+ internal class MethodElement : ConfigurationElement, IMethodSection
+ {
+ const string KeyName = "name";
+ const string KeyAllowAll = "allowAll";
+ const string KeyAllowGroup = "allowGroup";
+ const string KeyAllowType = "allowType";
+ const string KeyAllowMember = "allowMember";
+ const string KeyReturnXml = "returnXml";
+
+ [ConfigurationProperty(KeyName, IsKey = true, IsRequired = true)]
+ public string Name
+ {
+ get { return (string)base[KeyName]; }
+ }
+
+ [ConfigurationProperty(KeyAllowAll, IsKey = false, IsRequired = false, DefaultValue = false)]
+ public bool AllowAll
+ {
+ get { return (bool)base[KeyAllowAll]; }
+ }
+
+ [ConfigurationProperty(KeyAllowGroup, IsKey = false, IsRequired = false, DefaultValue = null)]
+ public string AllowGroup
+ {
+ get { return (string)base[KeyAllowGroup]; }
+ }
+
+ [ConfigurationProperty(KeyAllowType, IsKey = false, IsRequired = false, DefaultValue = null)]
+ public string AllowType
+ {
+ get { return (string)base[KeyAllowType]; }
+ }
+
+ [ConfigurationProperty(KeyAllowMember, IsKey = false, IsRequired = false, DefaultValue = null)]
+ public string AllowMember
+ {
+ get { return (string)base[KeyAllowMember]; }
+ }
+
+ [ConfigurationProperty(KeyReturnXml, IsKey = false, IsRequired = false, DefaultValue = true)]
+ public bool ReturnXml
+ {
+ get { return (bool)base[KeyReturnXml]; }
+ }
+ }
+}
diff --git a/src/Umbraco.Core/Configuration/CommaDelimitedConfigurationElement.cs b/src/Umbraco.Core/Configuration/CommaDelimitedConfigurationElement.cs
index 7cc8b68ff2..d8be9c850b 100644
--- a/src/Umbraco.Core/Configuration/CommaDelimitedConfigurationElement.cs
+++ b/src/Umbraco.Core/Configuration/CommaDelimitedConfigurationElement.cs
@@ -1,70 +1,70 @@
-using System.Collections;
-using System.Collections.Generic;
-using System.Collections.Specialized;
-using System.Configuration;
-
-namespace Umbraco.Core.Configuration
-{
- ///
- /// Defines a configuration section that contains inner text that is comma delimited
- ///
- internal class CommaDelimitedConfigurationElement : InnerTextConfigurationElement, IEnumerable
- {
- public override CommaDelimitedStringCollection Value
- {
- get
- {
- var converter = new CommaDelimitedStringCollectionConverter();
- return (CommaDelimitedStringCollection) converter.ConvertFrom(RawValue);
- }
- }
-
- IEnumerator IEnumerable.GetEnumerator()
- {
- return new InnerEnumerator(Value.GetEnumerator());
- }
-
- IEnumerator IEnumerable.GetEnumerator()
- {
- return new InnerEnumerator(Value.GetEnumerator());
- }
-
- ///
- /// A wrapper for StringEnumerator since it doesn't explicitly implement IEnumerable
- ///
- private class InnerEnumerator : IEnumerator
- {
- private readonly StringEnumerator _stringEnumerator;
-
- public InnerEnumerator(StringEnumerator stringEnumerator)
- {
- _stringEnumerator = stringEnumerator;
- }
-
- public bool MoveNext()
- {
- return _stringEnumerator.MoveNext();
- }
-
- public void Reset()
- {
- _stringEnumerator.Reset();
- }
-
- string IEnumerator.Current
- {
- get { return _stringEnumerator.Current; }
- }
-
- public object Current
- {
- get { return _stringEnumerator.Current; }
- }
-
- public void Dispose()
- {
- ObjectExtensions.DisposeIfDisposable(_stringEnumerator);
- }
- }
- }
+using System.Collections;
+using System.Collections.Generic;
+using System.Collections.Specialized;
+using System.Configuration;
+
+namespace Umbraco.Core.Configuration
+{
+ ///
+ /// Defines a configuration section that contains inner text that is comma delimited
+ ///
+ internal class CommaDelimitedConfigurationElement : InnerTextConfigurationElement, IEnumerable
+ {
+ public override CommaDelimitedStringCollection Value
+ {
+ get
+ {
+ var converter = new CommaDelimitedStringCollectionConverter();
+ return (CommaDelimitedStringCollection) converter.ConvertFrom(RawValue);
+ }
+ }
+
+ IEnumerator IEnumerable.GetEnumerator()
+ {
+ return new InnerEnumerator(Value.GetEnumerator());
+ }
+
+ IEnumerator IEnumerable.GetEnumerator()
+ {
+ return new InnerEnumerator(Value.GetEnumerator());
+ }
+
+ ///
+ /// A wrapper for StringEnumerator since it doesn't explicitly implement IEnumerable
+ ///
+ private class InnerEnumerator : IEnumerator
+ {
+ private readonly StringEnumerator _stringEnumerator;
+
+ public InnerEnumerator(StringEnumerator stringEnumerator)
+ {
+ _stringEnumerator = stringEnumerator;
+ }
+
+ public bool MoveNext()
+ {
+ return _stringEnumerator.MoveNext();
+ }
+
+ public void Reset()
+ {
+ _stringEnumerator.Reset();
+ }
+
+ string IEnumerator.Current
+ {
+ get { return _stringEnumerator.Current; }
+ }
+
+ public object Current
+ {
+ get { return _stringEnumerator.Current; }
+ }
+
+ public void Dispose()
+ {
+ ObjectExtensions.DisposeIfDisposable(_stringEnumerator);
+ }
+ }
+ }
}
\ No newline at end of file
diff --git a/src/Umbraco.Core/Configuration/Dashboard/AccessElement.cs b/src/Umbraco.Core/Configuration/Dashboard/AccessElement.cs
index bb798467b9..da7f7e3e49 100644
--- a/src/Umbraco.Core/Configuration/Dashboard/AccessElement.cs
+++ b/src/Umbraco.Core/Configuration/Dashboard/AccessElement.cs
@@ -1,34 +1,34 @@
-using System.Collections.Generic;
-using System.Linq;
-using System.Xml.Linq;
-
-namespace Umbraco.Core.Configuration.Dashboard
-{
- internal class AccessElement : RawXmlConfigurationElement, IAccess
- {
- public AccessElement()
- {
-
- }
-
- public AccessElement(XElement rawXml)
- :base(rawXml)
- {
- }
-
- public IEnumerable Rules
- {
- get
- {
- var result = new List();
- if (RawXml != null)
- {
- result.AddRange(RawXml.Elements("deny").Select(x => new AccessItem {Action = AccessType.Deny, Value = x.Value }));
- result.AddRange(RawXml.Elements("grant").Select(x => new AccessItem { Action = AccessType.Grant, Value = x.Value }));
- result.AddRange(RawXml.Elements("grantBySection").Select(x => new AccessItem { Action = AccessType.GrantBySection, Value = x.Value }));
- }
- return result;
- }
- }
- }
+using System.Collections.Generic;
+using System.Linq;
+using System.Xml.Linq;
+
+namespace Umbraco.Core.Configuration.Dashboard
+{
+ internal class AccessElement : RawXmlConfigurationElement, IAccess
+ {
+ public AccessElement()
+ {
+
+ }
+
+ public AccessElement(XElement rawXml)
+ :base(rawXml)
+ {
+ }
+
+ public IEnumerable Rules
+ {
+ get
+ {
+ var result = new List();
+ if (RawXml != null)
+ {
+ result.AddRange(RawXml.Elements("deny").Select(x => new AccessItem {Action = AccessType.Deny, Value = x.Value }));
+ result.AddRange(RawXml.Elements("grant").Select(x => new AccessItem { Action = AccessType.Grant, Value = x.Value }));
+ result.AddRange(RawXml.Elements("grantBySection").Select(x => new AccessItem { Action = AccessType.GrantBySection, Value = x.Value }));
+ }
+ return result;
+ }
+ }
+ }
}
\ No newline at end of file
diff --git a/src/Umbraco.Core/Configuration/Dashboard/AccessItem.cs b/src/Umbraco.Core/Configuration/Dashboard/AccessItem.cs
index 65ae6299d6..0daacfb17c 100644
--- a/src/Umbraco.Core/Configuration/Dashboard/AccessItem.cs
+++ b/src/Umbraco.Core/Configuration/Dashboard/AccessItem.cs
@@ -1,15 +1,15 @@
-namespace Umbraco.Core.Configuration.Dashboard
-{
- internal class AccessItem : IAccessItem
- {
- ///
- /// This can be grant, deny or grantBySection
- ///
- public AccessType Action { get; set; }
-
- ///
- /// The value of the action
- ///
- public string Value { get; set; }
- }
+namespace Umbraco.Core.Configuration.Dashboard
+{
+ internal class AccessItem : IAccessItem
+ {
+ ///
+ /// This can be grant, deny or grantBySection
+ ///
+ public AccessType Action { get; set; }
+
+ ///
+ /// The value of the action
+ ///
+ public string Value { get; set; }
+ }
}
\ No newline at end of file
diff --git a/src/Umbraco.Core/Configuration/Dashboard/AccessType.cs b/src/Umbraco.Core/Configuration/Dashboard/AccessType.cs
index 115d416010..afc74b671f 100644
--- a/src/Umbraco.Core/Configuration/Dashboard/AccessType.cs
+++ b/src/Umbraco.Core/Configuration/Dashboard/AccessType.cs
@@ -1,9 +1,9 @@
-namespace Umbraco.Core.Configuration.Dashboard
-{
- public enum AccessType
- {
- Grant,
- Deny,
- GrantBySection
- }
+namespace Umbraco.Core.Configuration.Dashboard
+{
+ public enum AccessType
+ {
+ Grant,
+ Deny,
+ GrantBySection
+ }
}
\ No newline at end of file
diff --git a/src/Umbraco.Core/Configuration/Dashboard/AreaCollection.cs b/src/Umbraco.Core/Configuration/Dashboard/AreaCollection.cs
index 03acce069f..ac3706d0d4 100644
--- a/src/Umbraco.Core/Configuration/Dashboard/AreaCollection.cs
+++ b/src/Umbraco.Core/Configuration/Dashboard/AreaCollection.cs
@@ -1,32 +1,32 @@
-using System.Collections;
-using System.Collections.Generic;
-using System.Configuration;
-
-namespace Umbraco.Core.Configuration.Dashboard
-{
- internal class AreaCollection : ConfigurationElementCollection, IEnumerable
- {
- protected override ConfigurationElement CreateNewElement()
- {
- return new AreaElement();
- }
-
- protected override object GetElementKey(ConfigurationElement element)
- {
- return ((AreaElement) element).Value;
- }
-
- IEnumerator IEnumerable.GetEnumerator()
- {
- for (var i = 0; i < Count; i++)
- {
- yield return BaseGet(i) as IArea;
- }
- }
-
- IEnumerator IEnumerable.GetEnumerator()
- {
- return GetEnumerator();
- }
- }
+using System.Collections;
+using System.Collections.Generic;
+using System.Configuration;
+
+namespace Umbraco.Core.Configuration.Dashboard
+{
+ internal class AreaCollection : ConfigurationElementCollection, IEnumerable
+ {
+ protected override ConfigurationElement CreateNewElement()
+ {
+ return new AreaElement();
+ }
+
+ protected override object GetElementKey(ConfigurationElement element)
+ {
+ return ((AreaElement) element).Value;
+ }
+
+ IEnumerator IEnumerable.GetEnumerator()
+ {
+ for (var i = 0; i < Count; i++)
+ {
+ yield return BaseGet(i) as IArea;
+ }
+ }
+
+ IEnumerator IEnumerable.GetEnumerator()
+ {
+ return GetEnumerator();
+ }
+ }
}
\ No newline at end of file
diff --git a/src/Umbraco.Core/Configuration/Dashboard/AreaElement.cs b/src/Umbraco.Core/Configuration/Dashboard/AreaElement.cs
index 1f498f9eae..baea6ce2cd 100644
--- a/src/Umbraco.Core/Configuration/Dashboard/AreaElement.cs
+++ b/src/Umbraco.Core/Configuration/Dashboard/AreaElement.cs
@@ -1,12 +1,12 @@
-using System.Configuration;
-
-namespace Umbraco.Core.Configuration.Dashboard
-{
- internal class AreaElement : InnerTextConfigurationElement, IArea
- {
- string IArea.AreaName
- {
- get { return Value; }
- }
- }
+using System.Configuration;
+
+namespace Umbraco.Core.Configuration.Dashboard
+{
+ internal class AreaElement : InnerTextConfigurationElement, IArea
+ {
+ string IArea.AreaName
+ {
+ get { return Value; }
+ }
+ }
}
\ No newline at end of file
diff --git a/src/Umbraco.Core/Configuration/Dashboard/AreasElement.cs b/src/Umbraco.Core/Configuration/Dashboard/AreasElement.cs
index 3b63a4188f..037c394799 100644
--- a/src/Umbraco.Core/Configuration/Dashboard/AreasElement.cs
+++ b/src/Umbraco.Core/Configuration/Dashboard/AreasElement.cs
@@ -1,15 +1,15 @@
-using System.Configuration;
-
-namespace Umbraco.Core.Configuration.Dashboard
-{
- internal class AreasElement : ConfigurationElement
- {
- [ConfigurationCollection(typeof(SectionCollection), AddItemName = "area")]
- [ConfigurationProperty("", IsDefaultCollection = true)]
- public AreaCollection AreaCollection
- {
- get { return (AreaCollection)base[""]; }
- set { base[""] = value; }
- }
- }
+using System.Configuration;
+
+namespace Umbraco.Core.Configuration.Dashboard
+{
+ internal class AreasElement : ConfigurationElement
+ {
+ [ConfigurationCollection(typeof(SectionCollection), AddItemName = "area")]
+ [ConfigurationProperty("", IsDefaultCollection = true)]
+ public AreaCollection AreaCollection
+ {
+ get { return (AreaCollection)base[""]; }
+ set { base[""] = value; }
+ }
+ }
}
\ No newline at end of file
diff --git a/src/Umbraco.Core/Configuration/Dashboard/ControlCollection.cs b/src/Umbraco.Core/Configuration/Dashboard/ControlCollection.cs
index 3ba0dd4c95..1b39c206c6 100644
--- a/src/Umbraco.Core/Configuration/Dashboard/ControlCollection.cs
+++ b/src/Umbraco.Core/Configuration/Dashboard/ControlCollection.cs
@@ -1,37 +1,37 @@
-using System.Collections;
-using System.Collections.Generic;
-using System.Configuration;
-
-namespace Umbraco.Core.Configuration.Dashboard
-{
- internal class ControlCollection : ConfigurationElementCollection, IEnumerable
- {
- internal void Add(ControlElement c)
- {
- BaseAdd(c);
- }
-
- protected override ConfigurationElement CreateNewElement()
- {
- return new ControlElement();
- }
-
- protected override object GetElementKey(ConfigurationElement element)
- {
- return ((ControlElement)element).ControlPath;
- }
-
- IEnumerator IEnumerable.GetEnumerator()
- {
- for (var i = 0; i < Count; i++)
- {
- yield return BaseGet(i) as IDashboardControl;
- }
- }
-
- IEnumerator IEnumerable.GetEnumerator()
- {
- return GetEnumerator();
- }
- }
+using System.Collections;
+using System.Collections.Generic;
+using System.Configuration;
+
+namespace Umbraco.Core.Configuration.Dashboard
+{
+ internal class ControlCollection : ConfigurationElementCollection, IEnumerable
+ {
+ internal void Add(ControlElement c)
+ {
+ BaseAdd(c);
+ }
+
+ protected override ConfigurationElement CreateNewElement()
+ {
+ return new ControlElement();
+ }
+
+ protected override object GetElementKey(ConfigurationElement element)
+ {
+ return ((ControlElement)element).ControlPath;
+ }
+
+ IEnumerator IEnumerable.GetEnumerator()
+ {
+ for (var i = 0; i < Count; i++)
+ {
+ yield return BaseGet(i) as IDashboardControl;
+ }
+ }
+
+ IEnumerator IEnumerable.GetEnumerator()
+ {
+ return GetEnumerator();
+ }
+ }
}
\ No newline at end of file
diff --git a/src/Umbraco.Core/Configuration/Dashboard/ControlElement.cs b/src/Umbraco.Core/Configuration/Dashboard/ControlElement.cs
index ac5c01ddeb..582998d1f2 100644
--- a/src/Umbraco.Core/Configuration/Dashboard/ControlElement.cs
+++ b/src/Umbraco.Core/Configuration/Dashboard/ControlElement.cs
@@ -1,74 +1,74 @@
-using System;
-using System.Configuration;
-using System.Linq;
-using System.Xml.Linq;
-
-namespace Umbraco.Core.Configuration.Dashboard
-{
-
- internal class ControlElement : RawXmlConfigurationElement, IDashboardControl
- {
- public bool ShowOnce
- {
- get
- {
- return RawXml.Attribute("showOnce") == null
- ? false
- : bool.Parse(RawXml.Attribute("showOnce").Value);
- }
- }
-
- public bool AddPanel
- {
- get
- {
- return RawXml.Attribute("addPanel") == null
- ? true
- : bool.Parse(RawXml.Attribute("addPanel").Value);
- }
- }
-
- public string PanelCaption
- {
- get
- {
- return RawXml.Attribute("panelCaption") == null
- ? ""
- : RawXml.Attribute("panelCaption").Value;
- }
- }
-
- public AccessElement Access
- {
- get
- {
- var access = RawXml.Element("access");
- if (access == null)
- {
- return new AccessElement();
- }
- return new AccessElement(access);
- }
- }
-
- public string ControlPath
- {
- get
- {
- //we need to return the first (and only) text element of the children (wtf... who designed this configuration ! :P )
- var txt = RawXml.Nodes().OfType().FirstOrDefault();
- if (txt == null)
- {
- throw new ConfigurationErrorsException("The control element must contain a text node indicating the control path");
- }
- return txt.Value.Trim();
- }
- }
-
-
- IAccess IDashboardControl.AccessRights
- {
- get { return Access; }
- }
- }
+using System;
+using System.Configuration;
+using System.Linq;
+using System.Xml.Linq;
+
+namespace Umbraco.Core.Configuration.Dashboard
+{
+
+ internal class ControlElement : RawXmlConfigurationElement, IDashboardControl
+ {
+ public bool ShowOnce
+ {
+ get
+ {
+ return RawXml.Attribute("showOnce") == null
+ ? false
+ : bool.Parse(RawXml.Attribute("showOnce").Value);
+ }
+ }
+
+ public bool AddPanel
+ {
+ get
+ {
+ return RawXml.Attribute("addPanel") == null
+ ? true
+ : bool.Parse(RawXml.Attribute("addPanel").Value);
+ }
+ }
+
+ public string PanelCaption
+ {
+ get
+ {
+ return RawXml.Attribute("panelCaption") == null
+ ? ""
+ : RawXml.Attribute("panelCaption").Value;
+ }
+ }
+
+ public AccessElement Access
+ {
+ get
+ {
+ var access = RawXml.Element("access");
+ if (access == null)
+ {
+ return new AccessElement();
+ }
+ return new AccessElement(access);
+ }
+ }
+
+ public string ControlPath
+ {
+ get
+ {
+ //we need to return the first (and only) text element of the children (wtf... who designed this configuration ! :P )
+ var txt = RawXml.Nodes().OfType().FirstOrDefault();
+ if (txt == null)
+ {
+ throw new ConfigurationErrorsException("The control element must contain a text node indicating the control path");
+ }
+ return txt.Value.Trim();
+ }
+ }
+
+
+ IAccess IDashboardControl.AccessRights
+ {
+ get { return Access; }
+ }
+ }
}
\ No newline at end of file
diff --git a/src/Umbraco.Core/Configuration/Dashboard/DashboardSection.cs b/src/Umbraco.Core/Configuration/Dashboard/DashboardSection.cs
index 12bf0522e0..4d78abcd6b 100644
--- a/src/Umbraco.Core/Configuration/Dashboard/DashboardSection.cs
+++ b/src/Umbraco.Core/Configuration/Dashboard/DashboardSection.cs
@@ -1,24 +1,24 @@
-using System;
-using System.Collections.Generic;
-using System.Configuration;
-using System.Text;
-using System.Threading.Tasks;
-
-namespace Umbraco.Core.Configuration.Dashboard
-{
- internal class DashboardSection : ConfigurationSection, IDashboardSection
- {
- [ConfigurationCollection(typeof(SectionCollection), AddItemName = "section")]
- [ConfigurationProperty("", IsDefaultCollection = true)]
- public SectionCollection SectionCollection
- {
- get { return (SectionCollection)base[""]; }
- set { base[""] = value; }
- }
-
- IEnumerable IDashboardSection.Sections
- {
- get { return SectionCollection; }
- }
- }
-}
+using System;
+using System.Collections.Generic;
+using System.Configuration;
+using System.Text;
+using System.Threading.Tasks;
+
+namespace Umbraco.Core.Configuration.Dashboard
+{
+ internal class DashboardSection : ConfigurationSection, IDashboardSection
+ {
+ [ConfigurationCollection(typeof(SectionCollection), AddItemName = "section")]
+ [ConfigurationProperty("", IsDefaultCollection = true)]
+ public SectionCollection SectionCollection
+ {
+ get { return (SectionCollection)base[""]; }
+ set { base[""] = value; }
+ }
+
+ IEnumerable IDashboardSection.Sections
+ {
+ get { return SectionCollection; }
+ }
+ }
+}
diff --git a/src/Umbraco.Core/Configuration/Dashboard/IAccess.cs b/src/Umbraco.Core/Configuration/Dashboard/IAccess.cs
index 9fee2f80e1..0c275e1373 100644
--- a/src/Umbraco.Core/Configuration/Dashboard/IAccess.cs
+++ b/src/Umbraco.Core/Configuration/Dashboard/IAccess.cs
@@ -1,9 +1,9 @@
-using System.Collections.Generic;
-
-namespace Umbraco.Core.Configuration.Dashboard
-{
- public interface IAccess
- {
- IEnumerable Rules { get; }
- }
+using System.Collections.Generic;
+
+namespace Umbraco.Core.Configuration.Dashboard
+{
+ public interface IAccess
+ {
+ IEnumerable Rules { get; }
+ }
}
\ No newline at end of file
diff --git a/src/Umbraco.Core/Configuration/Dashboard/IAccessItem.cs b/src/Umbraco.Core/Configuration/Dashboard/IAccessItem.cs
index 7583d46306..a0ae9c2d5e 100644
--- a/src/Umbraco.Core/Configuration/Dashboard/IAccessItem.cs
+++ b/src/Umbraco.Core/Configuration/Dashboard/IAccessItem.cs
@@ -1,15 +1,15 @@
-namespace Umbraco.Core.Configuration.Dashboard
-{
- public interface IAccessItem
- {
- ///
- /// This can be grant, deny or grantBySection
- ///
- AccessType Action { get; set; }
-
- ///
- /// The value of the action
- ///
- string Value { get; set; }
- }
+namespace Umbraco.Core.Configuration.Dashboard
+{
+ public interface IAccessItem
+ {
+ ///
+ /// This can be grant, deny or grantBySection
+ ///
+ AccessType Action { get; set; }
+
+ ///
+ /// The value of the action
+ ///
+ string Value { get; set; }
+ }
}
\ No newline at end of file
diff --git a/src/Umbraco.Core/Configuration/Dashboard/IArea.cs b/src/Umbraco.Core/Configuration/Dashboard/IArea.cs
index 08775ee12f..c562c915d7 100644
--- a/src/Umbraco.Core/Configuration/Dashboard/IArea.cs
+++ b/src/Umbraco.Core/Configuration/Dashboard/IArea.cs
@@ -1,7 +1,7 @@
-namespace Umbraco.Core.Configuration.Dashboard
-{
- public interface IArea
- {
- string AreaName { get; }
- }
+namespace Umbraco.Core.Configuration.Dashboard
+{
+ public interface IArea
+ {
+ string AreaName { get; }
+ }
}
\ No newline at end of file
diff --git a/src/Umbraco.Core/Configuration/Dashboard/IDashboardControl.cs b/src/Umbraco.Core/Configuration/Dashboard/IDashboardControl.cs
index d5812ca5e9..c362d3ed78 100644
--- a/src/Umbraco.Core/Configuration/Dashboard/IDashboardControl.cs
+++ b/src/Umbraco.Core/Configuration/Dashboard/IDashboardControl.cs
@@ -1,15 +1,15 @@
-namespace Umbraco.Core.Configuration.Dashboard
-{
- public interface IDashboardControl
- {
- bool ShowOnce { get; }
-
- bool AddPanel { get; }
-
- string PanelCaption { get; }
-
- string ControlPath { get; }
-
- IAccess AccessRights { get; }
- }
+namespace Umbraco.Core.Configuration.Dashboard
+{
+ public interface IDashboardControl
+ {
+ bool ShowOnce { get; }
+
+ bool AddPanel { get; }
+
+ string PanelCaption { get; }
+
+ string ControlPath { get; }
+
+ IAccess AccessRights { get; }
+ }
}
\ No newline at end of file
diff --git a/src/Umbraco.Core/Configuration/Dashboard/IDashboardSection.cs b/src/Umbraco.Core/Configuration/Dashboard/IDashboardSection.cs
index 555c9b7439..2b1da4a869 100644
--- a/src/Umbraco.Core/Configuration/Dashboard/IDashboardSection.cs
+++ b/src/Umbraco.Core/Configuration/Dashboard/IDashboardSection.cs
@@ -1,9 +1,9 @@
-using System.Collections.Generic;
-
-namespace Umbraco.Core.Configuration.Dashboard
-{
- public interface IDashboardSection
- {
- IEnumerable Sections { get; }
- }
+using System.Collections.Generic;
+
+namespace Umbraco.Core.Configuration.Dashboard
+{
+ public interface IDashboardSection
+ {
+ IEnumerable Sections { get; }
+ }
}
\ No newline at end of file
diff --git a/src/Umbraco.Core/Configuration/Dashboard/IDashboardTab.cs b/src/Umbraco.Core/Configuration/Dashboard/IDashboardTab.cs
index 0a03e81da4..28cdc64021 100644
--- a/src/Umbraco.Core/Configuration/Dashboard/IDashboardTab.cs
+++ b/src/Umbraco.Core/Configuration/Dashboard/IDashboardTab.cs
@@ -1,13 +1,13 @@
-using System.Collections.Generic;
-
-namespace Umbraco.Core.Configuration.Dashboard
-{
- public interface IDashboardTab
- {
- string Caption { get; }
-
- IEnumerable Controls { get; }
-
- IAccess AccessRights { get; }
- }
+using System.Collections.Generic;
+
+namespace Umbraco.Core.Configuration.Dashboard
+{
+ public interface IDashboardTab
+ {
+ string Caption { get; }
+
+ IEnumerable Controls { get; }
+
+ IAccess AccessRights { get; }
+ }
}
\ No newline at end of file
diff --git a/src/Umbraco.Core/Configuration/Dashboard/ISection.cs b/src/Umbraco.Core/Configuration/Dashboard/ISection.cs
index 39b86717e7..48c53382c6 100644
--- a/src/Umbraco.Core/Configuration/Dashboard/ISection.cs
+++ b/src/Umbraco.Core/Configuration/Dashboard/ISection.cs
@@ -1,15 +1,15 @@
-using System.Collections.Generic;
-
-namespace Umbraco.Core.Configuration.Dashboard
-{
- public interface ISection
- {
- string Alias { get; }
-
- IEnumerable Areas { get; }
-
- IEnumerable Tabs { get; }
-
- IAccess AccessRights { get; }
- }
+using System.Collections.Generic;
+
+namespace Umbraco.Core.Configuration.Dashboard
+{
+ public interface ISection
+ {
+ string Alias { get; }
+
+ IEnumerable Areas { get; }
+
+ IEnumerable Tabs { get; }
+
+ IAccess AccessRights { get; }
+ }
}
\ No newline at end of file
diff --git a/src/Umbraco.Core/Configuration/Dashboard/SectionCollection.cs b/src/Umbraco.Core/Configuration/Dashboard/SectionCollection.cs
index 395ce7f623..2f47de2af6 100644
--- a/src/Umbraco.Core/Configuration/Dashboard/SectionCollection.cs
+++ b/src/Umbraco.Core/Configuration/Dashboard/SectionCollection.cs
@@ -1,37 +1,37 @@
-using System.Collections;
-using System.Collections.Generic;
-using System.Configuration;
-
-namespace Umbraco.Core.Configuration.Dashboard
-{
- internal class SectionCollection : ConfigurationElementCollection, IEnumerable
- {
- internal void Add(SectionElement c)
- {
- BaseAdd(c);
- }
-
- protected override ConfigurationElement CreateNewElement()
- {
- return new SectionElement();
- }
-
- protected override object GetElementKey(ConfigurationElement element)
- {
- return ((SectionElement)element).Alias;
- }
-
- IEnumerator IEnumerable.GetEnumerator()
- {
- for (var i = 0; i < Count; i++)
- {
- yield return BaseGet(i) as ISection;
- }
- }
-
- IEnumerator IEnumerable.GetEnumerator()
- {
- return GetEnumerator();
- }
- }
+using System.Collections;
+using System.Collections.Generic;
+using System.Configuration;
+
+namespace Umbraco.Core.Configuration.Dashboard
+{
+ internal class SectionCollection : ConfigurationElementCollection, IEnumerable
+ {
+ internal void Add(SectionElement c)
+ {
+ BaseAdd(c);
+ }
+
+ protected override ConfigurationElement CreateNewElement()
+ {
+ return new SectionElement();
+ }
+
+ protected override object GetElementKey(ConfigurationElement element)
+ {
+ return ((SectionElement)element).Alias;
+ }
+
+ IEnumerator IEnumerable.GetEnumerator()
+ {
+ for (var i = 0; i < Count; i++)
+ {
+ yield return BaseGet(i) as ISection;
+ }
+ }
+
+ IEnumerator IEnumerable.GetEnumerator()
+ {
+ return GetEnumerator();
+ }
+ }
}
\ No newline at end of file
diff --git a/src/Umbraco.Core/Configuration/Dashboard/SectionElement.cs b/src/Umbraco.Core/Configuration/Dashboard/SectionElement.cs
index b34d2c6293..9adacd0b87 100644
--- a/src/Umbraco.Core/Configuration/Dashboard/SectionElement.cs
+++ b/src/Umbraco.Core/Configuration/Dashboard/SectionElement.cs
@@ -1,50 +1,50 @@
-using System.Collections.Generic;
-using System.Configuration;
-using System.Linq;
-
-namespace Umbraco.Core.Configuration.Dashboard
-{
- internal class SectionElement : ConfigurationElement, ISection
- {
- [ConfigurationProperty("alias", IsRequired = true)]
- public string Alias
- {
- get { return (string) this["alias"]; }
- }
-
- [ConfigurationProperty("areas", IsRequired = true)]
- public AreasElement Areas
- {
- get { return (AreasElement)this["areas"]; }
- }
-
- [ConfigurationProperty("access")]
- public AccessElement Access
- {
- get { return (AccessElement)this["access"]; }
- }
-
- [ConfigurationCollection(typeof(SectionCollection), AddItemName = "tab")]
- [ConfigurationProperty("", IsDefaultCollection = true)]
- public TabCollection TabCollection
- {
- get { return (TabCollection)base[""]; }
- set { base[""] = value; }
- }
-
- IEnumerable ISection.Tabs
- {
- get { return TabCollection; }
- }
-
- IEnumerable ISection.Areas
- {
- get { return Areas.AreaCollection.Cast().Select(x => x.Value); }
- }
-
- IAccess ISection.AccessRights
- {
- get { return Access; }
- }
- }
+using System.Collections.Generic;
+using System.Configuration;
+using System.Linq;
+
+namespace Umbraco.Core.Configuration.Dashboard
+{
+ internal class SectionElement : ConfigurationElement, ISection
+ {
+ [ConfigurationProperty("alias", IsRequired = true)]
+ public string Alias
+ {
+ get { return (string) this["alias"]; }
+ }
+
+ [ConfigurationProperty("areas", IsRequired = true)]
+ public AreasElement Areas
+ {
+ get { return (AreasElement)this["areas"]; }
+ }
+
+ [ConfigurationProperty("access")]
+ public AccessElement Access
+ {
+ get { return (AccessElement)this["access"]; }
+ }
+
+ [ConfigurationCollection(typeof(SectionCollection), AddItemName = "tab")]
+ [ConfigurationProperty("", IsDefaultCollection = true)]
+ public TabCollection TabCollection
+ {
+ get { return (TabCollection)base[""]; }
+ set { base[""] = value; }
+ }
+
+ IEnumerable ISection.Tabs
+ {
+ get { return TabCollection; }
+ }
+
+ IEnumerable ISection.Areas
+ {
+ get { return Areas.AreaCollection.Cast().Select(x => x.Value); }
+ }
+
+ IAccess ISection.AccessRights
+ {
+ get { return Access; }
+ }
+ }
}
\ No newline at end of file
diff --git a/src/Umbraco.Core/Configuration/Dashboard/TabCollection.cs b/src/Umbraco.Core/Configuration/Dashboard/TabCollection.cs
index 6f0e018a40..42aa912114 100644
--- a/src/Umbraco.Core/Configuration/Dashboard/TabCollection.cs
+++ b/src/Umbraco.Core/Configuration/Dashboard/TabCollection.cs
@@ -1,37 +1,37 @@
-using System.Collections;
-using System.Collections.Generic;
-using System.Configuration;
-
-namespace Umbraco.Core.Configuration.Dashboard
-{
- internal class TabCollection : ConfigurationElementCollection, IEnumerable
- {
- internal void Add(TabElement c)
- {
- BaseAdd(c);
- }
-
- protected override ConfigurationElement CreateNewElement()
- {
- return new TabElement();
- }
-
- protected override object GetElementKey(ConfigurationElement element)
- {
- return ((TabElement)element).Caption;
- }
-
- IEnumerator IEnumerable.GetEnumerator()
- {
- for (var i = 0; i < Count; i++)
- {
- yield return BaseGet(i) as IDashboardTab;
- }
- }
-
- IEnumerator IEnumerable.GetEnumerator()
- {
- return GetEnumerator();
- }
- }
+using System.Collections;
+using System.Collections.Generic;
+using System.Configuration;
+
+namespace Umbraco.Core.Configuration.Dashboard
+{
+ internal class TabCollection : ConfigurationElementCollection, IEnumerable
+ {
+ internal void Add(TabElement c)
+ {
+ BaseAdd(c);
+ }
+
+ protected override ConfigurationElement CreateNewElement()
+ {
+ return new TabElement();
+ }
+
+ protected override object GetElementKey(ConfigurationElement element)
+ {
+ return ((TabElement)element).Caption;
+ }
+
+ IEnumerator IEnumerable.GetEnumerator()
+ {
+ for (var i = 0; i < Count; i++)
+ {
+ yield return BaseGet(i) as IDashboardTab;
+ }
+ }
+
+ IEnumerator IEnumerable.GetEnumerator()
+ {
+ return GetEnumerator();
+ }
+ }
}
\ No newline at end of file
diff --git a/src/Umbraco.Core/Configuration/Dashboard/TabElement.cs b/src/Umbraco.Core/Configuration/Dashboard/TabElement.cs
index 2d83a7f5bb..abf3511db0 100644
--- a/src/Umbraco.Core/Configuration/Dashboard/TabElement.cs
+++ b/src/Umbraco.Core/Configuration/Dashboard/TabElement.cs
@@ -1,38 +1,38 @@
-using System.Collections.Generic;
-using System.Configuration;
-
-namespace Umbraco.Core.Configuration.Dashboard
-{
- internal class TabElement : ConfigurationElement, IDashboardTab
- {
- [ConfigurationProperty("caption", IsRequired = true)]
- public string Caption
- {
- get { return (string)this["caption"]; }
- }
-
- [ConfigurationProperty("access")]
- public AccessElement Access
- {
- get { return (AccessElement)this["access"]; }
- }
-
- [ConfigurationCollection(typeof(ControlCollection), AddItemName = "control")]
- [ConfigurationProperty("", IsDefaultCollection = true)]
- public ControlCollection ControlCollection
- {
- get { return (ControlCollection)base[""]; }
- set { base[""] = value; }
- }
-
- IEnumerable IDashboardTab.Controls
- {
- get { return ControlCollection; }
- }
-
- IAccess IDashboardTab.AccessRights
- {
- get { return Access; }
- }
- }
+using System.Collections.Generic;
+using System.Configuration;
+
+namespace Umbraco.Core.Configuration.Dashboard
+{
+ internal class TabElement : ConfigurationElement, IDashboardTab
+ {
+ [ConfigurationProperty("caption", IsRequired = true)]
+ public string Caption
+ {
+ get { return (string)this["caption"]; }
+ }
+
+ [ConfigurationProperty("access")]
+ public AccessElement Access
+ {
+ get { return (AccessElement)this["access"]; }
+ }
+
+ [ConfigurationCollection(typeof(ControlCollection), AddItemName = "control")]
+ [ConfigurationProperty("", IsDefaultCollection = true)]
+ public ControlCollection ControlCollection
+ {
+ get { return (ControlCollection)base[""]; }
+ set { base[""] = value; }
+ }
+
+ IEnumerable IDashboardTab.Controls
+ {
+ get { return ControlCollection; }
+ }
+
+ IAccess IDashboardTab.AccessRights
+ {
+ get { return Access; }
+ }
+ }
}
\ No newline at end of file
diff --git a/src/Umbraco.Core/Configuration/InnerTextConfigurationElement.cs b/src/Umbraco.Core/Configuration/InnerTextConfigurationElement.cs
index 107f9ecca0..966bbc6a11 100644
--- a/src/Umbraco.Core/Configuration/InnerTextConfigurationElement.cs
+++ b/src/Umbraco.Core/Configuration/InnerTextConfigurationElement.cs
@@ -1,69 +1,69 @@
-using System;
-using System.Xml;
-using System.Xml.Linq;
-
-namespace Umbraco.Core.Configuration
-{
- ///
- /// A full config section is required for any full element and we have some elements that are defined like this:
- /// {element}MyValue{/element} instead of as attribute values.
- ///
- ///
- internal class InnerTextConfigurationElement : RawXmlConfigurationElement
- {
- public InnerTextConfigurationElement()
- {
- }
-
- public InnerTextConfigurationElement(XElement rawXml) : base(rawXml)
- {
- }
-
- protected override void DeserializeElement(XmlReader reader, bool serializeCollectionKey)
- {
- base.DeserializeElement(reader, serializeCollectionKey);
- //now validate and set the raw value
- if (RawXml.HasElements)
- throw new InvalidOperationException("An InnerTextConfigurationElement cannot contain any child elements, only attributes and a value");
- RawValue = RawXml.Value.Trim();
-
- //RawValue = reader.ReadElementContentAsString();
- }
-
- public virtual T Value
- {
- get
- {
- var converted = ObjectExtensions.TryConvertTo(RawValue);
- if (converted.Success == false)
- throw new InvalidCastException("Could not convert value " + RawValue + " to type " + typeof(T));
- return converted.Result;
- }
- }
-
- ///
- /// Exposes the raw string value
- ///
- internal string RawValue { get; set; }
-
- ///
- /// Implicit operator so we don't need to use the 'Value' property explicitly
- ///
- ///
- ///
- public static implicit operator T(InnerTextConfigurationElement m)
- {
- return m.Value;
- }
-
- ///
- /// Return the string value of Value
- ///
- ///
- public override string ToString()
- {
- return string.Format("{0}", Value);
- }
-
- }
+using System;
+using System.Xml;
+using System.Xml.Linq;
+
+namespace Umbraco.Core.Configuration
+{
+ ///
+ /// A full config section is required for any full element and we have some elements that are defined like this:
+ /// {element}MyValue{/element} instead of as attribute values.
+ ///
+ ///
+ internal class InnerTextConfigurationElement : RawXmlConfigurationElement
+ {
+ public InnerTextConfigurationElement()
+ {
+ }
+
+ public InnerTextConfigurationElement(XElement rawXml) : base(rawXml)
+ {
+ }
+
+ protected override void DeserializeElement(XmlReader reader, bool serializeCollectionKey)
+ {
+ base.DeserializeElement(reader, serializeCollectionKey);
+ //now validate and set the raw value
+ if (RawXml.HasElements)
+ throw new InvalidOperationException("An InnerTextConfigurationElement cannot contain any child elements, only attributes and a value");
+ RawValue = RawXml.Value.Trim();
+
+ //RawValue = reader.ReadElementContentAsString();
+ }
+
+ public virtual T Value
+ {
+ get
+ {
+ var converted = ObjectExtensions.TryConvertTo(RawValue);
+ if (converted.Success == false)
+ throw new InvalidCastException("Could not convert value " + RawValue + " to type " + typeof(T));
+ return converted.Result;
+ }
+ }
+
+ ///
+ /// Exposes the raw string value
+ ///
+ internal string RawValue { get; set; }
+
+ ///
+ /// Implicit operator so we don't need to use the 'Value' property explicitly
+ ///
+ ///
+ ///
+ public static implicit operator T(InnerTextConfigurationElement m)
+ {
+ return m.Value;
+ }
+
+ ///
+ /// Return the string value of Value
+ ///
+ ///
+ public override string ToString()
+ {
+ return string.Format("{0}", Value);
+ }
+
+ }
}
\ No newline at end of file
diff --git a/src/Umbraco.Core/Configuration/OptionalCommaDelimitedConfigurationElement.cs b/src/Umbraco.Core/Configuration/OptionalCommaDelimitedConfigurationElement.cs
index 18062a9ed9..59ad883e03 100644
--- a/src/Umbraco.Core/Configuration/OptionalCommaDelimitedConfigurationElement.cs
+++ b/src/Umbraco.Core/Configuration/OptionalCommaDelimitedConfigurationElement.cs
@@ -1,43 +1,43 @@
-using System.Configuration;
-using Umbraco.Core.Configuration.UmbracoSettings;
-
-namespace Umbraco.Core.Configuration
-{
- ///
- /// Used for specifying default values for comma delimited config
- ///
- internal class OptionalCommaDelimitedConfigurationElement : CommaDelimitedConfigurationElement
- {
- private readonly CommaDelimitedConfigurationElement _wrapped;
- private readonly string[] _defaultValue;
-
- public OptionalCommaDelimitedConfigurationElement()
- {
- }
-
- public OptionalCommaDelimitedConfigurationElement(CommaDelimitedConfigurationElement wrapped, string[] defaultValue)
- {
- _wrapped = wrapped;
- _defaultValue = defaultValue;
- }
-
- public override CommaDelimitedStringCollection Value
- {
- get
- {
- if (_wrapped == null)
- {
- return base.Value;
- }
-
- if (string.IsNullOrEmpty(_wrapped.RawValue))
- {
- var val = new CommaDelimitedStringCollection();
- val.AddRange(_defaultValue);
- return val;
- }
- return _wrapped.Value;
- }
- }
- }
+using System.Configuration;
+using Umbraco.Core.Configuration.UmbracoSettings;
+
+namespace Umbraco.Core.Configuration
+{
+ ///
+ /// Used for specifying default values for comma delimited config
+ ///
+ internal class OptionalCommaDelimitedConfigurationElement : CommaDelimitedConfigurationElement
+ {
+ private readonly CommaDelimitedConfigurationElement _wrapped;
+ private readonly string[] _defaultValue;
+
+ public OptionalCommaDelimitedConfigurationElement()
+ {
+ }
+
+ public OptionalCommaDelimitedConfigurationElement(CommaDelimitedConfigurationElement wrapped, string[] defaultValue)
+ {
+ _wrapped = wrapped;
+ _defaultValue = defaultValue;
+ }
+
+ public override CommaDelimitedStringCollection Value
+ {
+ get
+ {
+ if (_wrapped == null)
+ {
+ return base.Value;
+ }
+
+ if (string.IsNullOrEmpty(_wrapped.RawValue))
+ {
+ var val = new CommaDelimitedStringCollection();
+ val.AddRange(_defaultValue);
+ return val;
+ }
+ return _wrapped.Value;
+ }
+ }
+ }
}
\ No newline at end of file
diff --git a/src/Umbraco.Core/Configuration/OptionalInnerTextConfigurationElement.cs b/src/Umbraco.Core/Configuration/OptionalInnerTextConfigurationElement.cs
index a2daf059b4..832a74fec2 100644
--- a/src/Umbraco.Core/Configuration/OptionalInnerTextConfigurationElement.cs
+++ b/src/Umbraco.Core/Configuration/OptionalInnerTextConfigurationElement.cs
@@ -1,23 +1,23 @@
-namespace Umbraco.Core.Configuration
-{
- ///
- /// This is used to supply optional/default values when using InnerTextConfigurationElement
- ///
- ///
- internal class OptionalInnerTextConfigurationElement : InnerTextConfigurationElement
- {
- private readonly InnerTextConfigurationElement _wrapped;
- private readonly T _defaultValue;
-
- public OptionalInnerTextConfigurationElement(InnerTextConfigurationElement wrapped, T defaultValue)
- {
- _wrapped = wrapped;
- _defaultValue = defaultValue;
- }
-
- public override T Value
- {
- get { return string.IsNullOrEmpty(_wrapped.RawValue) ? _defaultValue : _wrapped.Value; }
- }
- }
+namespace Umbraco.Core.Configuration
+{
+ ///
+ /// This is used to supply optional/default values when using InnerTextConfigurationElement
+ ///
+ ///
+ internal class OptionalInnerTextConfigurationElement : InnerTextConfigurationElement
+ {
+ private readonly InnerTextConfigurationElement _wrapped;
+ private readonly T _defaultValue;
+
+ public OptionalInnerTextConfigurationElement(InnerTextConfigurationElement wrapped, T defaultValue)
+ {
+ _wrapped = wrapped;
+ _defaultValue = defaultValue;
+ }
+
+ public override T Value
+ {
+ get { return string.IsNullOrEmpty(_wrapped.RawValue) ? _defaultValue : _wrapped.Value; }
+ }
+ }
}
\ No newline at end of file
diff --git a/src/Umbraco.Core/Configuration/RawXmlConfigurationElement.cs b/src/Umbraco.Core/Configuration/RawXmlConfigurationElement.cs
index aec3af9481..f2d2d8a52f 100644
--- a/src/Umbraco.Core/Configuration/RawXmlConfigurationElement.cs
+++ b/src/Umbraco.Core/Configuration/RawXmlConfigurationElement.cs
@@ -1,30 +1,30 @@
-using System.Configuration;
-using System.Xml;
-using System.Xml.Linq;
-
-namespace Umbraco.Core.Configuration
-{
- ///
- /// A configuration section that simply exposes the entire raw xml of the section itself which inheritors can use
- /// to do with as they please.
- ///
- internal abstract class RawXmlConfigurationElement : ConfigurationElement
- {
- protected RawXmlConfigurationElement()
- {
-
- }
-
- protected RawXmlConfigurationElement(XElement rawXml)
- {
- RawXml = rawXml;
- }
-
- protected override void DeserializeElement(XmlReader reader, bool serializeCollectionKey)
- {
- RawXml = (XElement)XNode.ReadFrom(reader);
- }
-
- protected XElement RawXml { get; private set; }
- }
+using System.Configuration;
+using System.Xml;
+using System.Xml.Linq;
+
+namespace Umbraco.Core.Configuration
+{
+ ///
+ /// A configuration section that simply exposes the entire raw xml of the section itself which inheritors can use
+ /// to do with as they please.
+ ///
+ internal abstract class RawXmlConfigurationElement : ConfigurationElement
+ {
+ protected RawXmlConfigurationElement()
+ {
+
+ }
+
+ protected RawXmlConfigurationElement(XElement rawXml)
+ {
+ RawXml = rawXml;
+ }
+
+ protected override void DeserializeElement(XmlReader reader, bool serializeCollectionKey)
+ {
+ RawXml = (XElement)XNode.ReadFrom(reader);
+ }
+
+ protected XElement RawXml { get; private set; }
+ }
}
\ No newline at end of file
diff --git a/src/Umbraco.Core/Configuration/UmbracoConfig.cs b/src/Umbraco.Core/Configuration/UmbracoConfig.cs
index 27f8b9b6a0..27fb572300 100644
--- a/src/Umbraco.Core/Configuration/UmbracoConfig.cs
+++ b/src/Umbraco.Core/Configuration/UmbracoConfig.cs
@@ -1,127 +1,127 @@
-using System;
-using System.Collections.Concurrent;
-using System.Collections.Generic;
-using System.Configuration;
-using System.Linq;
-using System.Threading;
-using Umbraco.Core.Configuration.BaseRest;
-using Umbraco.Core.Configuration.Dashboard;
-using Umbraco.Core.Configuration.UmbracoSettings;
-using Umbraco.Core.Logging;
-
-namespace Umbraco.Core.Configuration
-{
- ///
- /// The gateway to all umbraco configuration
- ///
- public class UmbracoConfig
- {
- #region Singleton
-
- private static readonly Lazy Lazy = new Lazy(() => new UmbracoConfig());
-
- public static UmbracoConfig For
- {
- get { return Lazy.Value; }
- }
-
- #endregion
-
- ///
- /// Default constructor
- ///
- private UmbracoConfig()
- {
- if (_umbracoSettings == null)
- {
- var umbracoSettings = ConfigurationManager.GetSection("umbracoConfiguration/settings") as IUmbracoSettingsSection;
- if (umbracoSettings == null)
- {
- LogHelper.Warn("Could not load the " + typeof(IUmbracoSettingsSection) + " from config file!");
- }
- SetUmbracoSettings(umbracoSettings);
- }
-
- if (_baseRestExtensions == null)
- {
- var baseRestExtensions = ConfigurationManager.GetSection("umbracoConfiguration/BaseRestExtensions") as IBaseRestSection;
- if (baseRestExtensions == null)
- {
- LogHelper.Warn("Could not load the " + typeof(IBaseRestSection) + " from config file!");
- }
- SetBaseRestExtensions(baseRestExtensions);
- }
-
- if (_dashboardSection == null)
- {
- var dashboardConfig = ConfigurationManager.GetSection("umbracoConfiguration/dashBoard") as IDashboardSection;
- if (dashboardConfig == null)
- {
- LogHelper.Warn("Could not load the " + typeof(IDashboardSection) + " from config file!");
- }
- SetDashboardSettings(dashboardConfig);
- }
- }
-
- ///
- /// Constructor - can be used for testing
- ///
- ///
- ///
- ///
- public UmbracoConfig(IUmbracoSettingsSection umbracoSettings, IBaseRestSection baseRestSettings, IDashboardSection dashboardSettings)
- {
- SetUmbracoSettings(umbracoSettings);
- SetBaseRestExtensions(baseRestSettings);
- SetDashboardSettings(dashboardSettings);
- }
-
- private IDashboardSection _dashboardSection;
- private IUmbracoSettingsSection _umbracoSettings;
- private IBaseRestSection _baseRestExtensions;
-
- ///
- /// Gets the IDashboardSection
- ///
- public IDashboardSection DashboardSettings()
- {
- return _dashboardSection;
- }
-
- //ONLY for unit testing
- internal void SetDashboardSettings(IDashboardSection value)
- {
- _dashboardSection = value;
- }
-
- //ONLY for unit testing
- internal void SetUmbracoSettings(IUmbracoSettingsSection value)
- {
- _umbracoSettings = value;
- }
-
- ///
- /// Gets the IUmbracoSettings
- ///
- public IUmbracoSettingsSection UmbracoSettings()
- {
- return _umbracoSettings;
- }
-
- //ONLY for unit testing
- public void SetBaseRestExtensions(IBaseRestSection value)
- {
- _baseRestExtensions = value;
- }
-
- ///
- /// Gets the IBaseRestSection
- ///
- public IBaseRestSection BaseRestExtensions()
- {
- return _baseRestExtensions;
- }
-
- //TODO: Add other configurations here !
- }
+using System;
+using System.Collections.Concurrent;
+using System.Collections.Generic;
+using System.Configuration;
+using System.Linq;
+using System.Threading;
+using Umbraco.Core.Configuration.BaseRest;
+using Umbraco.Core.Configuration.Dashboard;
+using Umbraco.Core.Configuration.UmbracoSettings;
+using Umbraco.Core.Logging;
+
+namespace Umbraco.Core.Configuration
+{
+ ///
+ /// The gateway to all umbraco configuration
+ ///
+ public class UmbracoConfig
+ {
+ #region Singleton
+
+ private static readonly Lazy Lazy = new Lazy(() => new UmbracoConfig());
+
+ public static UmbracoConfig For
+ {
+ get { return Lazy.Value; }
+ }
+
+ #endregion
+
+ ///
+ /// Default constructor
+ ///
+ private UmbracoConfig()
+ {
+ if (_umbracoSettings == null)
+ {
+ var umbracoSettings = ConfigurationManager.GetSection("umbracoConfiguration/settings") as IUmbracoSettingsSection;
+ if (umbracoSettings == null)
+ {
+ LogHelper.Warn("Could not load the " + typeof(IUmbracoSettingsSection) + " from config file!");
+ }
+ SetUmbracoSettings(umbracoSettings);
+ }
+
+ if (_baseRestExtensions == null)
+ {
+ var baseRestExtensions = ConfigurationManager.GetSection("umbracoConfiguration/BaseRestExtensions") as IBaseRestSection;
+ if (baseRestExtensions == null)
+ {
+ LogHelper.Warn("Could not load the " + typeof(IBaseRestSection) + " from config file!");
+ }
+ SetBaseRestExtensions(baseRestExtensions);
+ }
+
+ if (_dashboardSection == null)
+ {
+ var dashboardConfig = ConfigurationManager.GetSection("umbracoConfiguration/dashBoard") as IDashboardSection;
+ if (dashboardConfig == null)
+ {
+ LogHelper.Warn("Could not load the " + typeof(IDashboardSection) + " from config file!");
+ }
+ SetDashboardSettings(dashboardConfig);
+ }
+ }
+
+ ///
+ /// Constructor - can be used for testing
+ ///
+ ///
+ ///
+ ///
+ public UmbracoConfig(IUmbracoSettingsSection umbracoSettings, IBaseRestSection baseRestSettings, IDashboardSection dashboardSettings)
+ {
+ SetUmbracoSettings(umbracoSettings);
+ SetBaseRestExtensions(baseRestSettings);
+ SetDashboardSettings(dashboardSettings);
+ }
+
+ private IDashboardSection _dashboardSection;
+ private IUmbracoSettingsSection _umbracoSettings;
+ private IBaseRestSection _baseRestExtensions;
+
+ ///
+ /// Gets the IDashboardSection
+ ///
+ public IDashboardSection DashboardSettings()
+ {
+ return _dashboardSection;
+ }
+
+ //ONLY for unit testing
+ internal void SetDashboardSettings(IDashboardSection value)
+ {
+ _dashboardSection = value;
+ }
+
+ //ONLY for unit testing
+ internal void SetUmbracoSettings(IUmbracoSettingsSection value)
+ {
+ _umbracoSettings = value;
+ }
+
+ ///
+ /// Gets the IUmbracoSettings
+ ///
+ public IUmbracoSettingsSection UmbracoSettings()
+ {
+ return _umbracoSettings;
+ }
+
+ //ONLY for unit testing
+ public void SetBaseRestExtensions(IBaseRestSection value)
+ {
+ _baseRestExtensions = value;
+ }
+
+ ///
+ /// Gets the IBaseRestSection
+ ///
+ public IBaseRestSection BaseRestExtensions()
+ {
+ return _baseRestExtensions;
+ }
+
+ //TODO: Add other configurations here !
+ }
}
\ No newline at end of file
diff --git a/src/Umbraco.Core/Configuration/UmbracoSettings/IChar.cs b/src/Umbraco.Core/Configuration/UmbracoSettings/IChar.cs
index 7b5775cc48..4ec15603c2 100644
--- a/src/Umbraco.Core/Configuration/UmbracoSettings/IChar.cs
+++ b/src/Umbraco.Core/Configuration/UmbracoSettings/IChar.cs
@@ -1,8 +1,8 @@
-namespace Umbraco.Core.Configuration.UmbracoSettings
-{
- public interface IChar
- {
- string Char { get; }
- string Replacement { get; }
- }
+namespace Umbraco.Core.Configuration.UmbracoSettings
+{
+ public interface IChar
+ {
+ string Char { get; }
+ string Replacement { get; }
+ }
}
\ No newline at end of file
diff --git a/src/Umbraco.Core/Configuration/UmbracoSettings/IContentErrorPage.cs b/src/Umbraco.Core/Configuration/UmbracoSettings/IContentErrorPage.cs
index 3253d77bed..be342b1fb6 100644
--- a/src/Umbraco.Core/Configuration/UmbracoSettings/IContentErrorPage.cs
+++ b/src/Umbraco.Core/Configuration/UmbracoSettings/IContentErrorPage.cs
@@ -1,8 +1,8 @@
-namespace Umbraco.Core.Configuration.UmbracoSettings
-{
- public interface IContentErrorPage
- {
- int ContentId { get; }
- string Culture { get; set; }
- }
+namespace Umbraco.Core.Configuration.UmbracoSettings
+{
+ public interface IContentErrorPage
+ {
+ int ContentId { get; }
+ string Culture { get; set; }
+ }
}
\ No newline at end of file
diff --git a/src/Umbraco.Core/Configuration/UmbracoSettings/IContentSection.cs b/src/Umbraco.Core/Configuration/UmbracoSettings/IContentSection.cs
index 0ae68b751c..93e3260b44 100644
--- a/src/Umbraco.Core/Configuration/UmbracoSettings/IContentSection.cs
+++ b/src/Umbraco.Core/Configuration/UmbracoSettings/IContentSection.cs
@@ -1,63 +1,63 @@
-using System.Collections.Generic;
-
-namespace Umbraco.Core.Configuration.UmbracoSettings
-{
- public interface IContentSection : IUmbracoConfigurationSection
- {
- string NotificationEmailAddress { get; }
-
- bool DisableHtmlEmail { get; }
-
- IEnumerable ImageFileTypes { get; }
-
- IEnumerable ImageTagAllowedAttributes { get; }
-
- IEnumerable ImageAutoFillProperties { get; }
-
- string ScriptFolderPath { get; }
-
- IEnumerable ScriptFileTypes { get; }
-
- bool ScriptEditorDisable { get; }
-
- bool ResolveUrlsFromTextString { get; }
-
- bool UploadAllowDirectories { get; }
-
- IEnumerable Error404Collection { get; }
-
- bool EnsureUniqueNaming { get; }
-
- bool TidyEditorContent { get; }
-
- string TidyCharEncoding { get; }
-
- bool XmlCacheEnabled { get; }
-
- bool ContinouslyUpdateXmlDiskCache { get; }
-
- bool XmlContentCheckForDiskChanges { get; }
-
- bool EnableSplashWhileLoading { get; }
-
- string PropertyContextHelpOption { get; }
-
- bool UseLegacyXmlSchema { get; }
-
- bool ForceSafeAliases { get; }
-
- string PreviewBadge { get; }
-
- int UmbracoLibraryCacheDuration { get; }
-
- MacroErrorBehaviour MacroErrorBehaviour { get; }
-
- IEnumerable DisallowedUploadFiles { get; }
-
- bool CloneXmlContent { get; }
-
- bool GlobalPreviewStorageEnabled { get; }
-
- string DefaultDocumentTypeProperty { get; }
- }
+using System.Collections.Generic;
+
+namespace Umbraco.Core.Configuration.UmbracoSettings
+{
+ public interface IContentSection : IUmbracoConfigurationSection
+ {
+ string NotificationEmailAddress { get; }
+
+ bool DisableHtmlEmail { get; }
+
+ IEnumerable ImageFileTypes { get; }
+
+ IEnumerable ImageTagAllowedAttributes { get; }
+
+ IEnumerable ImageAutoFillProperties { get; }
+
+ string ScriptFolderPath { get; }
+
+ IEnumerable ScriptFileTypes { get; }
+
+ bool ScriptEditorDisable { get; }
+
+ bool ResolveUrlsFromTextString { get; }
+
+ bool UploadAllowDirectories { get; }
+
+ IEnumerable Error404Collection { get; }
+
+ bool EnsureUniqueNaming { get; }
+
+ bool TidyEditorContent { get; }
+
+ string TidyCharEncoding { get; }
+
+ bool XmlCacheEnabled { get; }
+
+ bool ContinouslyUpdateXmlDiskCache { get; }
+
+ bool XmlContentCheckForDiskChanges { get; }
+
+ bool EnableSplashWhileLoading { get; }
+
+ string PropertyContextHelpOption { get; }
+
+ bool UseLegacyXmlSchema { get; }
+
+ bool ForceSafeAliases { get; }
+
+ string PreviewBadge { get; }
+
+ int UmbracoLibraryCacheDuration { get; }
+
+ MacroErrorBehaviour MacroErrorBehaviour { get; }
+
+ IEnumerable DisallowedUploadFiles { get; }
+
+ bool CloneXmlContent { get; }
+
+ bool GlobalPreviewStorageEnabled { get; }
+
+ string DefaultDocumentTypeProperty { get; }
+ }
}
\ No newline at end of file
diff --git a/src/Umbraco.Core/Configuration/UmbracoSettings/IDeveloperSection.cs b/src/Umbraco.Core/Configuration/UmbracoSettings/IDeveloperSection.cs
index df6f8c0ed7..a1f1bffd3e 100644
--- a/src/Umbraco.Core/Configuration/UmbracoSettings/IDeveloperSection.cs
+++ b/src/Umbraco.Core/Configuration/UmbracoSettings/IDeveloperSection.cs
@@ -1,9 +1,9 @@
-using System.Collections.Generic;
-
-namespace Umbraco.Core.Configuration.UmbracoSettings
-{
- public interface IDeveloperSection : IUmbracoConfigurationSection
- {
- IEnumerable AppCodeFileExtensions { get; }
- }
+using System.Collections.Generic;
+
+namespace Umbraco.Core.Configuration.UmbracoSettings
+{
+ public interface IDeveloperSection : IUmbracoConfigurationSection
+ {
+ IEnumerable AppCodeFileExtensions { get; }
+ }
}
\ No newline at end of file
diff --git a/src/Umbraco.Core/Configuration/UmbracoSettings/IDistributedCallSection.cs b/src/Umbraco.Core/Configuration/UmbracoSettings/IDistributedCallSection.cs
index f3c0d5247a..5f8e51d60f 100644
--- a/src/Umbraco.Core/Configuration/UmbracoSettings/IDistributedCallSection.cs
+++ b/src/Umbraco.Core/Configuration/UmbracoSettings/IDistributedCallSection.cs
@@ -1,13 +1,13 @@
-using System.Collections.Generic;
-
-namespace Umbraco.Core.Configuration.UmbracoSettings
-{
- public interface IDistributedCallSection : IUmbracoConfigurationSection
- {
- bool Enabled { get; }
-
- int UserId { get; }
-
- IEnumerable Servers { get; }
- }
+using System.Collections.Generic;
+
+namespace Umbraco.Core.Configuration.UmbracoSettings
+{
+ public interface IDistributedCallSection : IUmbracoConfigurationSection
+ {
+ bool Enabled { get; }
+
+ int UserId { get; }
+
+ IEnumerable Servers { get; }
+ }
}
\ No newline at end of file
diff --git a/src/Umbraco.Core/Configuration/UmbracoSettings/IFileExtension.cs b/src/Umbraco.Core/Configuration/UmbracoSettings/IFileExtension.cs
index 91629f50ce..2d9ee19fcd 100644
--- a/src/Umbraco.Core/Configuration/UmbracoSettings/IFileExtension.cs
+++ b/src/Umbraco.Core/Configuration/UmbracoSettings/IFileExtension.cs
@@ -1,7 +1,7 @@
-namespace Umbraco.Core.Configuration.UmbracoSettings
-{
- public interface IFileExtension
- {
- string Extension { get; }
- }
+namespace Umbraco.Core.Configuration.UmbracoSettings
+{
+ public interface IFileExtension
+ {
+ string Extension { get; }
+ }
}
\ No newline at end of file
diff --git a/src/Umbraco.Core/Configuration/UmbracoSettings/IHelpSection.cs b/src/Umbraco.Core/Configuration/UmbracoSettings/IHelpSection.cs
index e8ee7195ee..61be2dfaf2 100644
--- a/src/Umbraco.Core/Configuration/UmbracoSettings/IHelpSection.cs
+++ b/src/Umbraco.Core/Configuration/UmbracoSettings/IHelpSection.cs
@@ -1,11 +1,11 @@
-using System.Collections.Generic;
-
-namespace Umbraco.Core.Configuration.UmbracoSettings
-{
- public interface IHelpSection : IUmbracoConfigurationSection
- {
- string DefaultUrl { get; }
-
- IEnumerable Links { get; }
- }
+using System.Collections.Generic;
+
+namespace Umbraco.Core.Configuration.UmbracoSettings
+{
+ public interface IHelpSection : IUmbracoConfigurationSection
+ {
+ string DefaultUrl { get; }
+
+ IEnumerable Links { get; }
+ }
}
\ No newline at end of file
diff --git a/src/Umbraco.Core/Configuration/UmbracoSettings/IImagingAutoFillUploadField.cs b/src/Umbraco.Core/Configuration/UmbracoSettings/IImagingAutoFillUploadField.cs
index 5dbeee02d0..6f42e14668 100644
--- a/src/Umbraco.Core/Configuration/UmbracoSettings/IImagingAutoFillUploadField.cs
+++ b/src/Umbraco.Core/Configuration/UmbracoSettings/IImagingAutoFillUploadField.cs
@@ -1,18 +1,18 @@
-namespace Umbraco.Core.Configuration.UmbracoSettings
-{
- public interface IImagingAutoFillUploadField
- {
- ///
- /// Allow setting internally so we can create a default
- ///
- string Alias { get; }
-
- string WidthFieldAlias { get; }
-
- string HeightFieldAlias { get; }
-
- string LengthFieldAlias { get; }
-
- string ExtensionFieldAlias { get; }
- }
+namespace Umbraco.Core.Configuration.UmbracoSettings
+{
+ public interface IImagingAutoFillUploadField
+ {
+ ///
+ /// Allow setting internally so we can create a default
+ ///
+ string Alias { get; }
+
+ string WidthFieldAlias { get; }
+
+ string HeightFieldAlias { get; }
+
+ string LengthFieldAlias { get; }
+
+ string ExtensionFieldAlias { get; }
+ }
}
\ No newline at end of file
diff --git a/src/Umbraco.Core/Configuration/UmbracoSettings/ILink.cs b/src/Umbraco.Core/Configuration/UmbracoSettings/ILink.cs
index 2085d29325..d2afec55f3 100644
--- a/src/Umbraco.Core/Configuration/UmbracoSettings/ILink.cs
+++ b/src/Umbraco.Core/Configuration/UmbracoSettings/ILink.cs
@@ -1,15 +1,15 @@
-namespace Umbraco.Core.Configuration.UmbracoSettings
-{
- public interface ILink
- {
- string Application { get; }
-
- string ApplicationUrl { get; }
-
- string Language { get; }
-
- string UserType { get; }
-
- string HelpUrl { get; }
- }
+namespace Umbraco.Core.Configuration.UmbracoSettings
+{
+ public interface ILink
+ {
+ string Application { get; }
+
+ string ApplicationUrl { get; }
+
+ string Language { get; }
+
+ string UserType { get; }
+
+ string HelpUrl { get; }
+ }
}
\ No newline at end of file
diff --git a/src/Umbraco.Core/Configuration/UmbracoSettings/ILogType.cs b/src/Umbraco.Core/Configuration/UmbracoSettings/ILogType.cs
index 68df770be0..559fb1fb13 100644
--- a/src/Umbraco.Core/Configuration/UmbracoSettings/ILogType.cs
+++ b/src/Umbraco.Core/Configuration/UmbracoSettings/ILogType.cs
@@ -1,7 +1,7 @@
-namespace Umbraco.Core.Configuration.UmbracoSettings
-{
- public interface ILogType
- {
- string LogTypeAlias { get; }
- }
+namespace Umbraco.Core.Configuration.UmbracoSettings
+{
+ public interface ILogType
+ {
+ string LogTypeAlias { get; }
+ }
}
\ No newline at end of file
diff --git a/src/Umbraco.Core/Configuration/UmbracoSettings/ILoggingSection.cs b/src/Umbraco.Core/Configuration/UmbracoSettings/ILoggingSection.cs
index df75a82f64..8a9a6ad29a 100644
--- a/src/Umbraco.Core/Configuration/UmbracoSettings/ILoggingSection.cs
+++ b/src/Umbraco.Core/Configuration/UmbracoSettings/ILoggingSection.cs
@@ -1,27 +1,27 @@
-using System.Collections.Generic;
-
-namespace Umbraco.Core.Configuration.UmbracoSettings
-{
- public interface ILoggingSection : IUmbracoConfigurationSection
- {
- bool AutoCleanLogs { get; }
-
- bool EnableLogging { get; }
-
- bool EnableAsyncLogging { get; }
-
- int CleaningMiliseconds { get; }
-
- int MaxLogAge { get; }
-
- IEnumerable DisabledLogTypes { get; }
-
- string ExternalLoggerAssembly { get; }
-
- string ExternalLoggerType { get; }
-
- bool ExternalLoggerEnableAuditTrail { get; }
-
- bool ExternalLoggerIsConfigured { get; }
- }
+using System.Collections.Generic;
+
+namespace Umbraco.Core.Configuration.UmbracoSettings
+{
+ public interface ILoggingSection : IUmbracoConfigurationSection
+ {
+ bool AutoCleanLogs { get; }
+
+ bool EnableLogging { get; }
+
+ bool EnableAsyncLogging { get; }
+
+ int CleaningMiliseconds { get; }
+
+ int MaxLogAge { get; }
+
+ IEnumerable DisabledLogTypes { get; }
+
+ string ExternalLoggerAssembly { get; }
+
+ string ExternalLoggerType { get; }
+
+ bool ExternalLoggerEnableAuditTrail { get; }
+
+ bool ExternalLoggerIsConfigured { get; }
+ }
}
\ No newline at end of file
diff --git a/src/Umbraco.Core/Configuration/UmbracoSettings/INotDynamicXmlDocument.cs b/src/Umbraco.Core/Configuration/UmbracoSettings/INotDynamicXmlDocument.cs
index 92c6ea990c..3ab1a9a67b 100644
--- a/src/Umbraco.Core/Configuration/UmbracoSettings/INotDynamicXmlDocument.cs
+++ b/src/Umbraco.Core/Configuration/UmbracoSettings/INotDynamicXmlDocument.cs
@@ -1,7 +1,7 @@
-namespace Umbraco.Core.Configuration.UmbracoSettings
-{
- public interface INotDynamicXmlDocument
- {
- string Element { get; }
- }
+namespace Umbraco.Core.Configuration.UmbracoSettings
+{
+ public interface INotDynamicXmlDocument
+ {
+ string Element { get; }
+ }
}
\ No newline at end of file
diff --git a/src/Umbraco.Core/Configuration/UmbracoSettings/IProvidersSection.cs b/src/Umbraco.Core/Configuration/UmbracoSettings/IProvidersSection.cs
index 6234cc6f2c..8a61bfffb3 100644
--- a/src/Umbraco.Core/Configuration/UmbracoSettings/IProvidersSection.cs
+++ b/src/Umbraco.Core/Configuration/UmbracoSettings/IProvidersSection.cs
@@ -1,9 +1,9 @@
-using System.Configuration;
-
-namespace Umbraco.Core.Configuration.UmbracoSettings
-{
- public interface IProvidersSection : IUmbracoConfigurationSection
- {
- string DefaultBackOfficeUserProvider { get; }
- }
+using System.Configuration;
+
+namespace Umbraco.Core.Configuration.UmbracoSettings
+{
+ public interface IProvidersSection : IUmbracoConfigurationSection
+ {
+ string DefaultBackOfficeUserProvider { get; }
+ }
}
\ No newline at end of file
diff --git a/src/Umbraco.Core/Configuration/UmbracoSettings/IRazorStaticMapping.cs b/src/Umbraco.Core/Configuration/UmbracoSettings/IRazorStaticMapping.cs
index 471afce319..a330fbcfac 100644
--- a/src/Umbraco.Core/Configuration/UmbracoSettings/IRazorStaticMapping.cs
+++ b/src/Umbraco.Core/Configuration/UmbracoSettings/IRazorStaticMapping.cs
@@ -1,12 +1,12 @@
-using System;
-
-namespace Umbraco.Core.Configuration.UmbracoSettings
-{
- public interface IRazorStaticMapping
- {
- Guid DataTypeGuid { get; }
- string NodeTypeAlias { get; }
- string PropertyTypeAlias { get; }
- string MappingName { get; }
- }
+using System;
+
+namespace Umbraco.Core.Configuration.UmbracoSettings
+{
+ public interface IRazorStaticMapping
+ {
+ Guid DataTypeGuid { get; }
+ string NodeTypeAlias { get; }
+ string PropertyTypeAlias { get; }
+ string MappingName { get; }
+ }
}
\ No newline at end of file
diff --git a/src/Umbraco.Core/Configuration/UmbracoSettings/IRepositoriesSection.cs b/src/Umbraco.Core/Configuration/UmbracoSettings/IRepositoriesSection.cs
index 746cc030e5..063acbe1cf 100644
--- a/src/Umbraco.Core/Configuration/UmbracoSettings/IRepositoriesSection.cs
+++ b/src/Umbraco.Core/Configuration/UmbracoSettings/IRepositoriesSection.cs
@@ -1,10 +1,10 @@
-using System.Collections.Generic;
-
-namespace Umbraco.Core.Configuration.UmbracoSettings
-{
-
- public interface IRepositoriesSection : IUmbracoConfigurationSection
- {
- IEnumerable Repositories { get; }
- }
+using System.Collections.Generic;
+
+namespace Umbraco.Core.Configuration.UmbracoSettings
+{
+
+ public interface IRepositoriesSection : IUmbracoConfigurationSection
+ {
+ IEnumerable Repositories { get; }
+ }
}
\ No newline at end of file
diff --git a/src/Umbraco.Core/Configuration/UmbracoSettings/IRepository.cs b/src/Umbraco.Core/Configuration/UmbracoSettings/IRepository.cs
index bb1757748c..052c23edd5 100644
--- a/src/Umbraco.Core/Configuration/UmbracoSettings/IRepository.cs
+++ b/src/Umbraco.Core/Configuration/UmbracoSettings/IRepository.cs
@@ -1,13 +1,13 @@
-using System;
-
-namespace Umbraco.Core.Configuration.UmbracoSettings
-{
- public interface IRepository
- {
- string Name { get; }
- Guid Id { get; }
- string RepositoryUrl { get; }
- string WebServiceUrl { get; }
- bool HasCustomWebServiceUrl { get; }
- }
+using System;
+
+namespace Umbraco.Core.Configuration.UmbracoSettings
+{
+ public interface IRepository
+ {
+ string Name { get; }
+ Guid Id { get; }
+ string RepositoryUrl { get; }
+ string WebServiceUrl { get; }
+ bool HasCustomWebServiceUrl { get; }
+ }
}
\ No newline at end of file
diff --git a/src/Umbraco.Core/Configuration/UmbracoSettings/IRequestHandlerSection.cs b/src/Umbraco.Core/Configuration/UmbracoSettings/IRequestHandlerSection.cs
index db11cfe883..43e6da24ac 100644
--- a/src/Umbraco.Core/Configuration/UmbracoSettings/IRequestHandlerSection.cs
+++ b/src/Umbraco.Core/Configuration/UmbracoSettings/IRequestHandlerSection.cs
@@ -1,15 +1,15 @@
-using System.Collections.Generic;
-
-namespace Umbraco.Core.Configuration.UmbracoSettings
-{
- public interface IRequestHandlerSection : IUmbracoConfigurationSection
- {
- bool UseDomainPrefixes { get; }
-
- bool AddTrailingSlash { get; }
-
- bool RemoveDoubleDashes { get; }
-
- IEnumerable CharCollection { get; }
- }
+using System.Collections.Generic;
+
+namespace Umbraco.Core.Configuration.UmbracoSettings
+{
+ public interface IRequestHandlerSection : IUmbracoConfigurationSection
+ {
+ bool UseDomainPrefixes { get; }
+
+ bool AddTrailingSlash { get; }
+
+ bool RemoveDoubleDashes { get; }
+
+ IEnumerable CharCollection { get; }
+ }
}
\ No newline at end of file
diff --git a/src/Umbraco.Core/Configuration/UmbracoSettings/IScheduledTask.cs b/src/Umbraco.Core/Configuration/UmbracoSettings/IScheduledTask.cs
index 4be62fbd17..46d4256170 100644
--- a/src/Umbraco.Core/Configuration/UmbracoSettings/IScheduledTask.cs
+++ b/src/Umbraco.Core/Configuration/UmbracoSettings/IScheduledTask.cs
@@ -1,13 +1,13 @@
-namespace Umbraco.Core.Configuration.UmbracoSettings
-{
- public interface IScheduledTask
- {
- string Alias { get; }
-
- bool Log { get; }
-
- int Interval { get; }
-
- string Url { get; }
- }
+namespace Umbraco.Core.Configuration.UmbracoSettings
+{
+ public interface IScheduledTask
+ {
+ string Alias { get; }
+
+ bool Log { get; }
+
+ int Interval { get; }
+
+ string Url { get; }
+ }
}
\ No newline at end of file
diff --git a/src/Umbraco.Core/Configuration/UmbracoSettings/IScheduledTasksSection.cs b/src/Umbraco.Core/Configuration/UmbracoSettings/IScheduledTasksSection.cs
index 334b97bfba..9d01549a5c 100644
--- a/src/Umbraco.Core/Configuration/UmbracoSettings/IScheduledTasksSection.cs
+++ b/src/Umbraco.Core/Configuration/UmbracoSettings/IScheduledTasksSection.cs
@@ -1,9 +1,9 @@
-using System.Collections.Generic;
-
-namespace Umbraco.Core.Configuration.UmbracoSettings
-{
- public interface IScheduledTasksSection : IUmbracoConfigurationSection
- {
- IEnumerable Tasks { get; }
- }
+using System.Collections.Generic;
+
+namespace Umbraco.Core.Configuration.UmbracoSettings
+{
+ public interface IScheduledTasksSection : IUmbracoConfigurationSection
+ {
+ IEnumerable Tasks { get; }
+ }
}
\ No newline at end of file
diff --git a/src/Umbraco.Core/Configuration/UmbracoSettings/IScriptingSection.cs b/src/Umbraco.Core/Configuration/UmbracoSettings/IScriptingSection.cs
index 37e93d55e8..c28dce98b8 100644
--- a/src/Umbraco.Core/Configuration/UmbracoSettings/IScriptingSection.cs
+++ b/src/Umbraco.Core/Configuration/UmbracoSettings/IScriptingSection.cs
@@ -1,11 +1,11 @@
-using System.Collections.Generic;
-
-namespace Umbraco.Core.Configuration.UmbracoSettings
-{
- public interface IScriptingSection : IUmbracoConfigurationSection
- {
- IEnumerable NotDynamicXmlDocumentElements { get; }
-
- IEnumerable DataTypeModelStaticMappings { get; }
- }
+using System.Collections.Generic;
+
+namespace Umbraco.Core.Configuration.UmbracoSettings
+{
+ public interface IScriptingSection : IUmbracoConfigurationSection
+ {
+ IEnumerable NotDynamicXmlDocumentElements { get; }
+
+ IEnumerable DataTypeModelStaticMappings { get; }
+ }
}
\ No newline at end of file
diff --git a/src/Umbraco.Core/Configuration/UmbracoSettings/ISecuritySection.cs b/src/Umbraco.Core/Configuration/UmbracoSettings/ISecuritySection.cs
index 37ff79ff07..c3a1df301d 100644
--- a/src/Umbraco.Core/Configuration/UmbracoSettings/ISecuritySection.cs
+++ b/src/Umbraco.Core/Configuration/UmbracoSettings/ISecuritySection.cs
@@ -1,13 +1,13 @@
-namespace Umbraco.Core.Configuration.UmbracoSettings
-{
- public interface ISecuritySection : IUmbracoConfigurationSection
- {
- bool KeepUserLoggedIn { get; }
-
- bool HideDisabledUsersInBackoffice { get; }
-
- string AuthCookieName { get; }
-
- string AuthCookieDomain { get; }
- }
+namespace Umbraco.Core.Configuration.UmbracoSettings
+{
+ public interface ISecuritySection : IUmbracoConfigurationSection
+ {
+ bool KeepUserLoggedIn { get; }
+
+ bool HideDisabledUsersInBackoffice { get; }
+
+ string AuthCookieName { get; }
+
+ string AuthCookieDomain { get; }
+ }
}
\ No newline at end of file
diff --git a/src/Umbraco.Core/Configuration/UmbracoSettings/IServer.cs b/src/Umbraco.Core/Configuration/UmbracoSettings/IServer.cs
index d8fd584bff..5ad0715302 100644
--- a/src/Umbraco.Core/Configuration/UmbracoSettings/IServer.cs
+++ b/src/Umbraco.Core/Configuration/UmbracoSettings/IServer.cs
@@ -1,9 +1,9 @@
-namespace Umbraco.Core.Configuration.UmbracoSettings
-{
- public interface IServer
- {
- string ForcePortnumber { get; }
- string ForceProtocol { get; }
- string ServerAddress { get; }
- }
+namespace Umbraco.Core.Configuration.UmbracoSettings
+{
+ public interface IServer
+ {
+ string ForcePortnumber { get; }
+ string ForceProtocol { get; }
+ string ServerAddress { get; }
+ }
}
\ No newline at end of file
diff --git a/src/Umbraco.Core/Configuration/UmbracoSettings/ITemplatesSection.cs b/src/Umbraco.Core/Configuration/UmbracoSettings/ITemplatesSection.cs
index 8db3a411ee..f6d104d291 100644
--- a/src/Umbraco.Core/Configuration/UmbracoSettings/ITemplatesSection.cs
+++ b/src/Umbraco.Core/Configuration/UmbracoSettings/ITemplatesSection.cs
@@ -1,13 +1,13 @@
-namespace Umbraco.Core.Configuration.UmbracoSettings
-{
- public interface ITemplatesSection : IUmbracoConfigurationSection
- {
- bool UseAspNetMasterPages { get; }
-
- bool EnableSkinSupport { get; }
-
- RenderingEngine DefaultRenderingEngine { get; }
-
- bool EnableTemplateFolders { get; }
- }
+namespace Umbraco.Core.Configuration.UmbracoSettings
+{
+ public interface ITemplatesSection : IUmbracoConfigurationSection
+ {
+ bool UseAspNetMasterPages { get; }
+
+ bool EnableSkinSupport { get; }
+
+ RenderingEngine DefaultRenderingEngine { get; }
+
+ bool EnableTemplateFolders { get; }
+ }
}
\ No newline at end of file
diff --git a/src/Umbraco.Core/Configuration/UmbracoSettings/IUmbracoSettingsSection.cs b/src/Umbraco.Core/Configuration/UmbracoSettings/IUmbracoSettingsSection.cs
index 5189d3002d..899de7d1f9 100644
--- a/src/Umbraco.Core/Configuration/UmbracoSettings/IUmbracoSettingsSection.cs
+++ b/src/Umbraco.Core/Configuration/UmbracoSettings/IUmbracoSettingsSection.cs
@@ -1,33 +1,33 @@
-namespace Umbraco.Core.Configuration.UmbracoSettings
-{
- public interface IUmbracoSettingsSection : IUmbracoConfigurationSection
- {
- IContentSection Content { get; }
-
- ISecuritySection Security { get; }
-
- IRequestHandlerSection RequestHandler { get; }
-
- ITemplatesSection Templates { get; }
-
- IDeveloperSection Developer { get; }
-
- IViewStateMoverModuleSection ViewStateMoverModule { get; }
-
- ILoggingSection Logging { get; }
-
- IScheduledTasksSection ScheduledTasks { get; }
-
- IDistributedCallSection DistributedCall { get; }
-
- IRepositoriesSection PackageRepositories { get; }
-
- IProvidersSection Providers { get; }
-
- IHelpSection Help { get; }
-
- IWebRoutingSection WebRouting { get; }
-
- IScriptingSection Scripting { get; }
- }
+namespace Umbraco.Core.Configuration.UmbracoSettings
+{
+ public interface IUmbracoSettingsSection : IUmbracoConfigurationSection
+ {
+ IContentSection Content { get; }
+
+ ISecuritySection Security { get; }
+
+ IRequestHandlerSection RequestHandler { get; }
+
+ ITemplatesSection Templates { get; }
+
+ IDeveloperSection Developer { get; }
+
+ IViewStateMoverModuleSection ViewStateMoverModule { get; }
+
+ ILoggingSection Logging { get; }
+
+ IScheduledTasksSection ScheduledTasks { get; }
+
+ IDistributedCallSection DistributedCall { get; }
+
+ IRepositoriesSection PackageRepositories { get; }
+
+ IProvidersSection Providers { get; }
+
+ IHelpSection Help { get; }
+
+ IWebRoutingSection WebRouting { get; }
+
+ IScriptingSection Scripting { get; }
+ }
}
\ No newline at end of file
diff --git a/src/Umbraco.Core/Configuration/UmbracoSettings/IViewStateMoverModuleSection.cs b/src/Umbraco.Core/Configuration/UmbracoSettings/IViewStateMoverModuleSection.cs
index 953e18ef1e..150827dccb 100644
--- a/src/Umbraco.Core/Configuration/UmbracoSettings/IViewStateMoverModuleSection.cs
+++ b/src/Umbraco.Core/Configuration/UmbracoSettings/IViewStateMoverModuleSection.cs
@@ -1,7 +1,7 @@
-namespace Umbraco.Core.Configuration.UmbracoSettings
-{
- public interface IViewStateMoverModuleSection : IUmbracoConfigurationSection
- {
- bool Enable { get; }
- }
+namespace Umbraco.Core.Configuration.UmbracoSettings
+{
+ public interface IViewStateMoverModuleSection : IUmbracoConfigurationSection
+ {
+ bool Enable { get; }
+ }
}
\ No newline at end of file
diff --git a/src/Umbraco.Core/Configuration/UmbracoSettings/IWebRoutingSection.cs b/src/Umbraco.Core/Configuration/UmbracoSettings/IWebRoutingSection.cs
index 73177ed2af..03fad06d82 100644
--- a/src/Umbraco.Core/Configuration/UmbracoSettings/IWebRoutingSection.cs
+++ b/src/Umbraco.Core/Configuration/UmbracoSettings/IWebRoutingSection.cs
@@ -1,12 +1,12 @@
-namespace Umbraco.Core.Configuration.UmbracoSettings
-{
- public interface IWebRoutingSection : IUmbracoConfigurationSection
- {
- bool TrySkipIisCustomErrors { get; }
-
- bool InternalRedirectPreservesTemplate { get; }
-
- string UrlProviderMode { get; }
- }
-
+namespace Umbraco.Core.Configuration.UmbracoSettings
+{
+ public interface IWebRoutingSection : IUmbracoConfigurationSection
+ {
+ bool TrySkipIisCustomErrors { get; }
+
+ bool InternalRedirectPreservesTemplate { get; }
+
+ string UrlProviderMode { get; }
+ }
+
}
\ No newline at end of file
diff --git a/src/Umbraco.Core/Configuration/UmbracoSettings/ImagingAutoFillPropertiesCollection.cs b/src/Umbraco.Core/Configuration/UmbracoSettings/ImagingAutoFillPropertiesCollection.cs
index 981172349d..28cca97c8e 100644
--- a/src/Umbraco.Core/Configuration/UmbracoSettings/ImagingAutoFillPropertiesCollection.cs
+++ b/src/Umbraco.Core/Configuration/UmbracoSettings/ImagingAutoFillPropertiesCollection.cs
@@ -1,37 +1,37 @@
-using System.Collections.Generic;
-using System.Configuration;
-
-namespace Umbraco.Core.Configuration.UmbracoSettings
-{
- internal class ImagingAutoFillPropertiesCollection : ConfigurationElementCollection, IEnumerable
- {
-
- protected override ConfigurationElement CreateNewElement()
- {
- return new ImagingAutoFillUploadFieldElement();
- }
-
- protected override object GetElementKey(ConfigurationElement element)
- {
- return ((ImagingAutoFillUploadFieldElement)element).Alias;
- }
-
- internal void Add(ImagingAutoFillUploadFieldElement item)
- {
- BaseAdd(item);
- }
-
- IEnumerator IEnumerable.GetEnumerator()
- {
- for (var i = 0; i < Count; i++)
- {
- yield return BaseGet(i) as IImagingAutoFillUploadField;
- }
- }
-
- System.Collections.IEnumerator System.Collections.IEnumerable.GetEnumerator()
- {
- return GetEnumerator();
- }
- }
+using System.Collections.Generic;
+using System.Configuration;
+
+namespace Umbraco.Core.Configuration.UmbracoSettings
+{
+ internal class ImagingAutoFillPropertiesCollection : ConfigurationElementCollection, IEnumerable
+ {
+
+ protected override ConfigurationElement CreateNewElement()
+ {
+ return new ImagingAutoFillUploadFieldElement();
+ }
+
+ protected override object GetElementKey(ConfigurationElement element)
+ {
+ return ((ImagingAutoFillUploadFieldElement)element).Alias;
+ }
+
+ internal void Add(ImagingAutoFillUploadFieldElement item)
+ {
+ BaseAdd(item);
+ }
+
+ IEnumerator IEnumerable.GetEnumerator()
+ {
+ for (var i = 0; i < Count; i++)
+ {
+ yield return BaseGet(i) as IImagingAutoFillUploadField;
+ }
+ }
+
+ System.Collections.IEnumerator System.Collections.IEnumerable.GetEnumerator()
+ {
+ return GetEnumerator();
+ }
+ }
}
\ No newline at end of file
diff --git a/src/Umbraco.Core/Configuration/UmbracoSettings/ImagingAutoFillUploadFieldElement.cs b/src/Umbraco.Core/Configuration/UmbracoSettings/ImagingAutoFillUploadFieldElement.cs
index e23aae8b8e..0dfc4afc00 100644
--- a/src/Umbraco.Core/Configuration/UmbracoSettings/ImagingAutoFillUploadFieldElement.cs
+++ b/src/Umbraco.Core/Configuration/UmbracoSettings/ImagingAutoFillUploadFieldElement.cs
@@ -1,91 +1,91 @@
-using System.Configuration;
-
-namespace Umbraco.Core.Configuration.UmbracoSettings
-{
- internal class ImagingAutoFillUploadFieldElement : ConfigurationElement, IImagingAutoFillUploadField
- {
- ///
- /// Allow setting internally so we can create a default
- ///
- [ConfigurationProperty("alias", IsKey = true, IsRequired = true)]
- public string Alias
- {
- get { return (string)this["alias"]; }
- set { this["alias"] = value; }
- }
-
- [ConfigurationProperty("widthFieldAlias")]
- internal InnerTextConfigurationElement WidthFieldAlias
- {
- get
- {
- return new OptionalInnerTextConfigurationElement(
- (InnerTextConfigurationElement)this["widthFieldAlias"],
- //set the default
- "umbracoWidth");
- }
- }
-
- [ConfigurationProperty("heightFieldAlias")]
- internal InnerTextConfigurationElement HeightFieldAlias
- {
- get
- {
- return new OptionalInnerTextConfigurationElement(
- (InnerTextConfigurationElement)this["heightFieldAlias"],
- //set the default
- "umbracoHeight");
- }
- }
-
- [ConfigurationProperty("lengthFieldAlias")]
- internal InnerTextConfigurationElement LengthFieldAlias
- {
- get
- {
- return new OptionalInnerTextConfigurationElement(
- (InnerTextConfigurationElement)this["lengthFieldAlias"],
- //set the default
- "umbracoBytes");
- }
- }
-
- [ConfigurationProperty("extensionFieldAlias")]
- internal InnerTextConfigurationElement ExtensionFieldAlias
- {
- get
- {
- return new OptionalInnerTextConfigurationElement(
- (InnerTextConfigurationElement)this["extensionFieldAlias"],
- //set the default
- "umbracoExtension");
- }
- }
-
- string IImagingAutoFillUploadField.Alias
- {
- get { return Alias; }
-
- }
-
- string IImagingAutoFillUploadField.WidthFieldAlias
- {
- get { return WidthFieldAlias; }
- }
-
- string IImagingAutoFillUploadField.HeightFieldAlias
- {
- get { return HeightFieldAlias; }
- }
-
- string IImagingAutoFillUploadField.LengthFieldAlias
- {
- get { return LengthFieldAlias; }
- }
-
- string IImagingAutoFillUploadField.ExtensionFieldAlias
- {
- get { return ExtensionFieldAlias; }
- }
- }
+using System.Configuration;
+
+namespace Umbraco.Core.Configuration.UmbracoSettings
+{
+ internal class ImagingAutoFillUploadFieldElement : ConfigurationElement, IImagingAutoFillUploadField
+ {
+ ///
+ /// Allow setting internally so we can create a default
+ ///
+ [ConfigurationProperty("alias", IsKey = true, IsRequired = true)]
+ public string Alias
+ {
+ get { return (string)this["alias"]; }
+ set { this["alias"] = value; }
+ }
+
+ [ConfigurationProperty("widthFieldAlias")]
+ internal InnerTextConfigurationElement WidthFieldAlias
+ {
+ get
+ {
+ return new OptionalInnerTextConfigurationElement(
+ (InnerTextConfigurationElement)this["widthFieldAlias"],
+ //set the default
+ "umbracoWidth");
+ }
+ }
+
+ [ConfigurationProperty("heightFieldAlias")]
+ internal InnerTextConfigurationElement HeightFieldAlias
+ {
+ get
+ {
+ return new OptionalInnerTextConfigurationElement(
+ (InnerTextConfigurationElement)this["heightFieldAlias"],
+ //set the default
+ "umbracoHeight");
+ }
+ }
+
+ [ConfigurationProperty("lengthFieldAlias")]
+ internal InnerTextConfigurationElement LengthFieldAlias
+ {
+ get
+ {
+ return new OptionalInnerTextConfigurationElement(
+ (InnerTextConfigurationElement)this["lengthFieldAlias"],
+ //set the default
+ "umbracoBytes");
+ }
+ }
+
+ [ConfigurationProperty("extensionFieldAlias")]
+ internal InnerTextConfigurationElement ExtensionFieldAlias
+ {
+ get
+ {
+ return new OptionalInnerTextConfigurationElement(
+ (InnerTextConfigurationElement)this["extensionFieldAlias"],
+ //set the default
+ "umbracoExtension");
+ }
+ }
+
+ string IImagingAutoFillUploadField.Alias
+ {
+ get { return Alias; }
+
+ }
+
+ string IImagingAutoFillUploadField.WidthFieldAlias
+ {
+ get { return WidthFieldAlias; }
+ }
+
+ string IImagingAutoFillUploadField.HeightFieldAlias
+ {
+ get { return HeightFieldAlias; }
+ }
+
+ string IImagingAutoFillUploadField.LengthFieldAlias
+ {
+ get { return LengthFieldAlias; }
+ }
+
+ string IImagingAutoFillUploadField.ExtensionFieldAlias
+ {
+ get { return ExtensionFieldAlias; }
+ }
+ }
}
\ No newline at end of file
diff --git a/src/Umbraco.Core/Constants-Examine.cs b/src/Umbraco.Core/Constants-Examine.cs
index f040634506..4ff6115749 100644
--- a/src/Umbraco.Core/Constants-Examine.cs
+++ b/src/Umbraco.Core/Constants-Examine.cs
@@ -1,24 +1,24 @@
-using System;
-using System.Collections.Generic;
-using System.Linq;
-using System.Text;
-using System.Threading.Tasks;
-
-namespace Umbraco.Core
-{
- public static partial class Constants
- {
- public static class Examine
- {
- ///
- /// The alias of the internal member searcher
- ///
- public const string InternalMemberSearcher = "InternalMemberSearcher";
-
- ///
- /// The alias of the internal content searcher
- ///
- public const string InternalSearcher = "InternalSearcher";
- }
- }
-}
+using System;
+using System.Collections.Generic;
+using System.Linq;
+using System.Text;
+using System.Threading.Tasks;
+
+namespace Umbraco.Core
+{
+ public static partial class Constants
+ {
+ public static class Examine
+ {
+ ///
+ /// The alias of the internal member searcher
+ ///
+ public const string InternalMemberSearcher = "InternalMemberSearcher";
+
+ ///
+ /// The alias of the internal content searcher
+ ///
+ public const string InternalSearcher = "InternalSearcher";
+ }
+ }
+}
diff --git a/src/Umbraco.Core/IDisposeOnRequestEnd.cs b/src/Umbraco.Core/IDisposeOnRequestEnd.cs
index cf1ec3a177..111b97b842 100644
--- a/src/Umbraco.Core/IDisposeOnRequestEnd.cs
+++ b/src/Umbraco.Core/IDisposeOnRequestEnd.cs
@@ -1,14 +1,14 @@
-using System;
-using System.Collections.Generic;
-using System.Linq;
-using System.Text;
-
-namespace Umbraco.Core
-{
- ///
- /// Any class implementing this interface that is added to the httpcontext.items keys or values will be disposed of at the end of the request.
- ///
- public interface IDisposeOnRequestEnd : IDisposable
- {
- }
-}
+using System;
+using System.Collections.Generic;
+using System.Linq;
+using System.Text;
+
+namespace Umbraco.Core
+{
+ ///
+ /// Any class implementing this interface that is added to the httpcontext.items keys or values will be disposed of at the end of the request.
+ ///
+ public interface IDisposeOnRequestEnd : IDisposable
+ {
+ }
+}
diff --git a/src/Umbraco.Core/Manifest/ParameterEditorConverter.cs b/src/Umbraco.Core/Manifest/ParameterEditorConverter.cs
index 6d60dd3ab8..5f25f9ad81 100644
--- a/src/Umbraco.Core/Manifest/ParameterEditorConverter.cs
+++ b/src/Umbraco.Core/Manifest/ParameterEditorConverter.cs
@@ -1,31 +1,31 @@
-using System;
-using Newtonsoft.Json;
-using Newtonsoft.Json.Linq;
-using Umbraco.Core.PropertyEditors;
-using Umbraco.Core.Serialization;
-
-namespace Umbraco.Core.Manifest
-{
- ///
- /// Used to convert a parameter editor manifest to a property editor object
- ///
- internal class ParameterEditorConverter : JsonCreationConverter
- {
- protected override ParameterEditor Create(Type objectType, JObject jObject)
- {
- return new ParameterEditor();
- }
-
- protected override void Deserialize(JObject jObject, ParameterEditor target, JsonSerializer serializer)
- {
- //since it's a manifest editor, we need to create it's instance.
- //we need to specify the view value for the editor here otherwise we'll get an exception.
- target.ManifestDefinedParameterValueEditor = new ParameterValueEditor
- {
- View = jObject["view"].ToString()
- };
-
- base.Deserialize(jObject, target, serializer);
- }
- }
+using System;
+using Newtonsoft.Json;
+using Newtonsoft.Json.Linq;
+using Umbraco.Core.PropertyEditors;
+using Umbraco.Core.Serialization;
+
+namespace Umbraco.Core.Manifest
+{
+ ///
+ /// Used to convert a parameter editor manifest to a property editor object
+ ///
+ internal class ParameterEditorConverter : JsonCreationConverter
+ {
+ protected override ParameterEditor Create(Type objectType, JObject jObject)
+ {
+ return new ParameterEditor();
+ }
+
+ protected override void Deserialize(JObject jObject, ParameterEditor target, JsonSerializer serializer)
+ {
+ //since it's a manifest editor, we need to create it's instance.
+ //we need to specify the view value for the editor here otherwise we'll get an exception.
+ target.ManifestDefinedParameterValueEditor = new ParameterValueEditor
+ {
+ View = jObject["view"].ToString()
+ };
+
+ base.Deserialize(jObject, target, serializer);
+ }
+ }
}
\ No newline at end of file
diff --git a/src/Umbraco.Core/Media/ImageHelper.cs b/src/Umbraco.Core/Media/ImageHelper.cs
index 02454fc648..d419f6ffdc 100644
--- a/src/Umbraco.Core/Media/ImageHelper.cs
+++ b/src/Umbraco.Core/Media/ImageHelper.cs
@@ -1,144 +1,144 @@
-using System;
-using System.Collections.Generic;
-using System.Drawing;
-using System.Drawing.Drawing2D;
-using System.Drawing.Imaging;
-using System.Globalization;
-using System.IO;
-using System.Linq;
-using System.Threading.Tasks;
-using Umbraco.Core.Configuration;
-using Umbraco.Core.IO;
-
-
-namespace Umbraco.Core.Media
-{
- ///
- /// A helper class used for imaging
- ///
- internal static class ImageHelper
- {
- public static string GetMimeType(this Image image)
- {
- var format = image.RawFormat;
- var codec = ImageCodecInfo.GetImageDecoders().First(c => c.FormatID == format.Guid);
- return codec.MimeType;
- }
-
- internal static IEnumerable GenerateMediaThumbnails(
- IFileSystem fs,
- string fileName,
- string extension,
- Image originalImage,
- IEnumerable additionalThumbSizes)
- {
- // Make default thumbnails
- var thumbs = new List
- {
- Resize(fs, fileName, extension, 100, "thumb", originalImage),
- Resize(fs, fileName, extension, 500, "big-thumb", originalImage)
- };
-
- //make custom ones
- foreach (var thumb in additionalThumbSizes.Where(x => x > 0).Distinct())
- {
- thumbs.Add(Resize(fs, fileName, extension, thumb, string.Format("thumb_{0}", thumb), originalImage));
- }
-
- return thumbs;
- }
-
- private static ResizedImage Resize(IFileSystem fileSystem, string path, string extension, int maxWidthHeight, string fileNameAddition, Image originalImage)
- {
- var fileNameThumb = String.IsNullOrEmpty(fileNameAddition)
- ? string.Format("{0}_UMBRACOSYSTHUMBNAIL.jpg", path.Substring(0, path.LastIndexOf(".")))
- : string.Format("{0}_{1}.jpg", path.Substring(0, path.LastIndexOf(".")), fileNameAddition);
-
- var thumb = GenerateThumbnail(
- originalImage,
- maxWidthHeight,
- fileNameThumb,
- extension,
- fileSystem);
-
- return thumb;
- }
-
- internal static ResizedImage GenerateThumbnail(Image image, int maxWidthHeight, string thumbnailFileName, string extension, IFileSystem fs)
- {
- return GenerateThumbnail(image, maxWidthHeight, -1, -1, thumbnailFileName, extension, fs);
- }
-
- internal static ResizedImage GenerateThumbnail(Image image, int fixedWidth, int fixedHeight, string thumbnailFileName, string extension, IFileSystem fs)
- {
- return GenerateThumbnail(image, -1, fixedWidth, fixedHeight, thumbnailFileName, extension, fs);
- }
-
- private static ResizedImage GenerateThumbnail(Image image, int maxWidthHeight, int fixedWidth, int fixedHeight, string thumbnailFileName, string extension, IFileSystem fs)
- {
- // Generate thumbnail
- float f = 1;
- if (maxWidthHeight >= 0)
- {
- var fx = (float)image.Size.Width / maxWidthHeight;
- var fy = (float)image.Size.Height / maxWidthHeight;
-
- // must fit in thumbnail size
- f = Math.Max(fx, fy);
- }
-
- //depending on if we are doing fixed width resizing or not.
- fixedWidth = (maxWidthHeight > 0) ? image.Width : fixedWidth;
- fixedHeight = (maxWidthHeight > 0) ? image.Height : fixedHeight;
-
- var widthTh = (int)Math.Round(fixedWidth / f);
- var heightTh = (int)Math.Round(fixedHeight / f);
-
- // fixes for empty width or height
- if (widthTh == 0)
- widthTh = 1;
- if (heightTh == 0)
- heightTh = 1;
-
- // Create new image with best quality settings
- using (var bp = new Bitmap(widthTh, heightTh))
- {
- using (var g = Graphics.FromImage(bp))
- {
- g.SmoothingMode = SmoothingMode.HighQuality;
- g.InterpolationMode = InterpolationMode.HighQualityBicubic;
- g.PixelOffsetMode = PixelOffsetMode.HighQuality;
- g.CompositingQuality = CompositingQuality.HighQuality;
-
- // Copy the old image to the new and resized
- var rect = new Rectangle(0, 0, widthTh, heightTh);
- g.DrawImage(image, rect, 0, 0, image.Width, image.Height, GraphicsUnit.Pixel);
-
- // Copy metadata
- var imageEncoders = ImageCodecInfo.GetImageEncoders();
-
- var codec = extension.ToLower() == "png" || extension.ToLower() == "gif"
- ? imageEncoders.Single(t => t.MimeType.Equals("image/png"))
- : imageEncoders.Single(t => t.MimeType.Equals("image/jpeg"));
-
- // Set compresion ratio to 90%
- var ep = new EncoderParameters();
- ep.Param[0] = new EncoderParameter(Encoder.Quality, 90L);
-
- // Save the new image using the dimensions of the image
- var newFileName = thumbnailFileName.Replace("UMBRACOSYSTHUMBNAIL", string.Format("{0}x{1}", widthTh, heightTh));
- using (var ms = new MemoryStream())
- {
- bp.Save(ms, codec, ep);
- ms.Seek(0, 0);
-
- fs.AddFile(newFileName, ms);
- }
-
- return new ResizedImage(widthTh, heightTh, newFileName);
- }
- }
- }
-
- }
-}
+using System;
+using System.Collections.Generic;
+using System.Drawing;
+using System.Drawing.Drawing2D;
+using System.Drawing.Imaging;
+using System.Globalization;
+using System.IO;
+using System.Linq;
+using System.Threading.Tasks;
+using Umbraco.Core.Configuration;
+using Umbraco.Core.IO;
+
+
+namespace Umbraco.Core.Media
+{
+ ///
+ /// A helper class used for imaging
+ ///
+ internal static class ImageHelper
+ {
+ public static string GetMimeType(this Image image)
+ {
+ var format = image.RawFormat;
+ var codec = ImageCodecInfo.GetImageDecoders().First(c => c.FormatID == format.Guid);
+ return codec.MimeType;
+ }
+
+ internal static IEnumerable GenerateMediaThumbnails(
+ IFileSystem fs,
+ string fileName,
+ string extension,
+ Image originalImage,
+ IEnumerable additionalThumbSizes)
+ {
+ // Make default thumbnails
+ var thumbs = new List
+ {
+ Resize(fs, fileName, extension, 100, "thumb", originalImage),
+ Resize(fs, fileName, extension, 500, "big-thumb", originalImage)
+ };
+
+ //make custom ones
+ foreach (var thumb in additionalThumbSizes.Where(x => x > 0).Distinct())
+ {
+ thumbs.Add(Resize(fs, fileName, extension, thumb, string.Format("thumb_{0}", thumb), originalImage));
+ }
+
+ return thumbs;
+ }
+
+ private static ResizedImage Resize(IFileSystem fileSystem, string path, string extension, int maxWidthHeight, string fileNameAddition, Image originalImage)
+ {
+ var fileNameThumb = String.IsNullOrEmpty(fileNameAddition)
+ ? string.Format("{0}_UMBRACOSYSTHUMBNAIL.jpg", path.Substring(0, path.LastIndexOf(".")))
+ : string.Format("{0}_{1}.jpg", path.Substring(0, path.LastIndexOf(".")), fileNameAddition);
+
+ var thumb = GenerateThumbnail(
+ originalImage,
+ maxWidthHeight,
+ fileNameThumb,
+ extension,
+ fileSystem);
+
+ return thumb;
+ }
+
+ internal static ResizedImage GenerateThumbnail(Image image, int maxWidthHeight, string thumbnailFileName, string extension, IFileSystem fs)
+ {
+ return GenerateThumbnail(image, maxWidthHeight, -1, -1, thumbnailFileName, extension, fs);
+ }
+
+ internal static ResizedImage GenerateThumbnail(Image image, int fixedWidth, int fixedHeight, string thumbnailFileName, string extension, IFileSystem fs)
+ {
+ return GenerateThumbnail(image, -1, fixedWidth, fixedHeight, thumbnailFileName, extension, fs);
+ }
+
+ private static ResizedImage GenerateThumbnail(Image image, int maxWidthHeight, int fixedWidth, int fixedHeight, string thumbnailFileName, string extension, IFileSystem fs)
+ {
+ // Generate thumbnail
+ float f = 1;
+ if (maxWidthHeight >= 0)
+ {
+ var fx = (float)image.Size.Width / maxWidthHeight;
+ var fy = (float)image.Size.Height / maxWidthHeight;
+
+ // must fit in thumbnail size
+ f = Math.Max(fx, fy);
+ }
+
+ //depending on if we are doing fixed width resizing or not.
+ fixedWidth = (maxWidthHeight > 0) ? image.Width : fixedWidth;
+ fixedHeight = (maxWidthHeight > 0) ? image.Height : fixedHeight;
+
+ var widthTh = (int)Math.Round(fixedWidth / f);
+ var heightTh = (int)Math.Round(fixedHeight / f);
+
+ // fixes for empty width or height
+ if (widthTh == 0)
+ widthTh = 1;
+ if (heightTh == 0)
+ heightTh = 1;
+
+ // Create new image with best quality settings
+ using (var bp = new Bitmap(widthTh, heightTh))
+ {
+ using (var g = Graphics.FromImage(bp))
+ {
+ g.SmoothingMode = SmoothingMode.HighQuality;
+ g.InterpolationMode = InterpolationMode.HighQualityBicubic;
+ g.PixelOffsetMode = PixelOffsetMode.HighQuality;
+ g.CompositingQuality = CompositingQuality.HighQuality;
+
+ // Copy the old image to the new and resized
+ var rect = new Rectangle(0, 0, widthTh, heightTh);
+ g.DrawImage(image, rect, 0, 0, image.Width, image.Height, GraphicsUnit.Pixel);
+
+ // Copy metadata
+ var imageEncoders = ImageCodecInfo.GetImageEncoders();
+
+ var codec = extension.ToLower() == "png" || extension.ToLower() == "gif"
+ ? imageEncoders.Single(t => t.MimeType.Equals("image/png"))
+ : imageEncoders.Single(t => t.MimeType.Equals("image/jpeg"));
+
+ // Set compresion ratio to 90%
+ var ep = new EncoderParameters();
+ ep.Param[0] = new EncoderParameter(Encoder.Quality, 90L);
+
+ // Save the new image using the dimensions of the image
+ var newFileName = thumbnailFileName.Replace("UMBRACOSYSTHUMBNAIL", string.Format("{0}x{1}", widthTh, heightTh));
+ using (var ms = new MemoryStream())
+ {
+ bp.Save(ms, codec, ep);
+ ms.Seek(0, 0);
+
+ fs.AddFile(newFileName, ms);
+ }
+
+ return new ResizedImage(widthTh, heightTh, newFileName);
+ }
+ }
+ }
+
+ }
+}
diff --git a/src/Umbraco.Core/Models/IMacro.cs b/src/Umbraco.Core/Models/IMacro.cs
index 7ca3d8d18f..f28160c345 100644
--- a/src/Umbraco.Core/Models/IMacro.cs
+++ b/src/Umbraco.Core/Models/IMacro.cs
@@ -1,93 +1,93 @@
-using System.Collections.Generic;
-using System.Runtime.Serialization;
-using Umbraco.Core.Models.EntityBase;
-
-namespace Umbraco.Core.Models
-{
- ///
- /// Defines a Macro
- ///
- public interface IMacro : IAggregateRoot
- {
- ///
- /// Gets or sets the alias of the Macro
- ///
- [DataMember]
- string Alias { get; set; }
-
- ///
- /// Gets or sets the name of the Macro
- ///
- [DataMember]
- string Name { get; set; }
-
- ///
- /// Gets or sets a boolean indicating whether the Macro can be used in an Editor
- ///
- [DataMember]
- bool UseInEditor { get; set; }
-
- ///
- /// Gets or sets the Cache Duration for the Macro
- ///
- [DataMember]
- int CacheDuration { get; set; }
-
- ///
- /// Gets or sets a boolean indicating whether the Macro should be Cached by Page
- ///
- [DataMember]
- bool CacheByPage { get; set; }
-
- ///
- /// Gets or sets a boolean indicating whether the Macro should be Cached Personally
- ///
- [DataMember]
- bool CacheByMember { get; set; }
-
- ///
- /// Gets or sets a boolean indicating whether the Macro should be rendered in an Editor
- ///
- [DataMember]
- bool DontRender { get; set; }
-
- ///
- /// Gets or sets the path to user control or the Control Type to render
- ///
- [DataMember]
- string ControlType { get; set; }
-
- ///
- /// Gets or sets the name of the assembly, which should be used by the Macro
- ///
- /// Will usually only be filled if the ScriptFile is a Usercontrol
- [DataMember]
- string ControlAssembly { get; set; }
-
- ///
- /// Gets or set the path to the Python file in use
- ///
- /// Optional: Can only be one of three Script, Python or Xslt
- [DataMember]
- string ScriptPath { get; set; }
-
- ///
- /// Gets or sets the path to the Xslt file in use
- ///
- /// Optional: Can only be one of three Script, Python or Xslt
- [DataMember]
- string XsltPath { get; set; }
-
- ///
- /// Gets or sets a list of Macro Properties
- ///
- [DataMember]
- MacroPropertyCollection Properties { get; }
-
- /////
- ///// Returns an enum based on the properties on the Macro
- /////
- /////
- //MacroTypes MacroType();
- }
+using System.Collections.Generic;
+using System.Runtime.Serialization;
+using Umbraco.Core.Models.EntityBase;
+
+namespace Umbraco.Core.Models
+{
+ ///
+ /// Defines a Macro
+ ///
+ public interface IMacro : IAggregateRoot
+ {
+ ///
+ /// Gets or sets the alias of the Macro
+ ///
+ [DataMember]
+ string Alias { get; set; }
+
+ ///
+ /// Gets or sets the name of the Macro
+ ///
+ [DataMember]
+ string Name { get; set; }
+
+ ///
+ /// Gets or sets a boolean indicating whether the Macro can be used in an Editor
+ ///
+ [DataMember]
+ bool UseInEditor { get; set; }
+
+ ///
+ /// Gets or sets the Cache Duration for the Macro
+ ///
+ [DataMember]
+ int CacheDuration { get; set; }
+
+ ///
+ /// Gets or sets a boolean indicating whether the Macro should be Cached by Page
+ ///
+ [DataMember]
+ bool CacheByPage { get; set; }
+
+ ///
+ /// Gets or sets a boolean indicating whether the Macro should be Cached Personally
+ ///
+ [DataMember]
+ bool CacheByMember { get; set; }
+
+ ///
+ /// Gets or sets a boolean indicating whether the Macro should be rendered in an Editor
+ ///
+ [DataMember]
+ bool DontRender { get; set; }
+
+ ///
+ /// Gets or sets the path to user control or the Control Type to render
+ ///
+ [DataMember]
+ string ControlType { get; set; }
+
+ ///
+ /// Gets or sets the name of the assembly, which should be used by the Macro
+ ///
+ /// Will usually only be filled if the ScriptFile is a Usercontrol
+ [DataMember]
+ string ControlAssembly { get; set; }
+
+ ///
+ /// Gets or set the path to the Python file in use
+ ///
+ /// Optional: Can only be one of three Script, Python or Xslt
+ [DataMember]
+ string ScriptPath { get; set; }
+
+ ///
+ /// Gets or sets the path to the Xslt file in use
+ ///
+ /// Optional: Can only be one of three Script, Python or Xslt
+ [DataMember]
+ string XsltPath { get; set; }
+
+ ///
+ /// Gets or sets a list of Macro Properties
+ ///
+ [DataMember]
+ MacroPropertyCollection Properties { get; }
+
+ /////
+ ///// Returns an enum based on the properties on the Macro
+ /////
+ /////
+ //MacroTypes MacroType();
+ }
}
\ No newline at end of file
diff --git a/src/Umbraco.Core/Models/IMacroProperty.cs b/src/Umbraco.Core/Models/IMacroProperty.cs
index 7e8e60690f..551d60304c 100644
--- a/src/Umbraco.Core/Models/IMacroProperty.cs
+++ b/src/Umbraco.Core/Models/IMacroProperty.cs
@@ -1,38 +1,38 @@
-using System.Runtime.Serialization;
-using Umbraco.Core.Models.EntityBase;
-
-namespace Umbraco.Core.Models
-{
- ///
- /// Defines a Property for a Macro
- ///
- public interface IMacroProperty : IValueObject
- {
- [DataMember]
- int Id { get; set; }
-
- ///
- /// Gets or sets the Alias of the Property
- ///
- [DataMember]
- string Alias { get; set; }
-
- ///
- /// Gets or sets the Name of the Property
- ///
- [DataMember]
- string Name { get; set; }
-
- ///
- /// Gets or sets the Sort Order of the Property
- ///
- [DataMember]
- int SortOrder { get; set; }
-
- ///
- /// Gets or sets the parameter editor alias
- ///
- [DataMember]
- string EditorAlias { get; set; }
- }
+using System.Runtime.Serialization;
+using Umbraco.Core.Models.EntityBase;
+
+namespace Umbraco.Core.Models
+{
+ ///
+ /// Defines a Property for a Macro
+ ///
+ public interface IMacroProperty : IValueObject
+ {
+ [DataMember]
+ int Id { get; set; }
+
+ ///
+ /// Gets or sets the Alias of the Property
+ ///
+ [DataMember]
+ string Alias { get; set; }
+
+ ///
+ /// Gets or sets the Name of the Property
+ ///
+ [DataMember]
+ string Name { get; set; }
+
+ ///
+ /// Gets or sets the Sort Order of the Property
+ ///
+ [DataMember]
+ int SortOrder { get; set; }
+
+ ///
+ /// Gets or sets the parameter editor alias
+ ///
+ [DataMember]
+ string EditorAlias { get; set; }
+ }
}
\ No newline at end of file
diff --git a/src/Umbraco.Core/Models/IMacroPropertyType.cs b/src/Umbraco.Core/Models/IMacroPropertyType.cs
index 55002a3d82..7c4bc0057f 100644
--- a/src/Umbraco.Core/Models/IMacroPropertyType.cs
+++ b/src/Umbraco.Core/Models/IMacroPropertyType.cs
@@ -1,28 +1,28 @@
-namespace Umbraco.Core.Models
-{
- ///
- /// Defines a PropertyType (plugin) for a Macro
- ///
- internal interface IMacroPropertyType
- {
- ///
- /// Gets the unique Alias of the Property Type
- ///
- string Alias { get; }
-
- ///
- /// Gets the name of the Assembly used to render the Property Type
- ///
- string RenderingAssembly { get; }
-
- ///
- /// Gets the name of the Type used to render the Property Type
- ///
- string RenderingType { get; }
-
- ///
- /// Gets the Base Type for storing the PropertyType (Int32, String, Boolean)
- ///
- MacroPropertyTypeBaseTypes BaseType { get; }
- }
+namespace Umbraco.Core.Models
+{
+ ///
+ /// Defines a PropertyType (plugin) for a Macro
+ ///
+ internal interface IMacroPropertyType
+ {
+ ///
+ /// Gets the unique Alias of the Property Type
+ ///
+ string Alias { get; }
+
+ ///
+ /// Gets the name of the Assembly used to render the Property Type
+ ///
+ string RenderingAssembly { get; }
+
+ ///
+ /// Gets the name of the Type used to render the Property Type
+ ///
+ string RenderingType { get; }
+
+ ///
+ /// Gets the Base Type for storing the PropertyType (Int32, String, Boolean)
+ ///
+ MacroPropertyTypeBaseTypes BaseType { get; }
+ }
}
\ No newline at end of file
diff --git a/src/Umbraco.Core/Models/IMember.cs b/src/Umbraco.Core/Models/IMember.cs
index 0b347a2515..edacd0b62b 100644
--- a/src/Umbraco.Core/Models/IMember.cs
+++ b/src/Umbraco.Core/Models/IMember.cs
@@ -1,114 +1,114 @@
-using System;
-
-namespace Umbraco.Core.Models
-{
- public interface IMember : IContentBase
- {
- ///
- /// Gets or sets the Username
- ///
- string Username { get; set; }
-
- ///
- /// Gets or sets the Email
- ///
- string Email { get; set; }
-
- ///
- /// Gets or sets the Password
- ///
- string Password { get; set; }
-
- ///
- /// Gets or sets the Password Question
- ///
- ///
- /// Alias: umbracoPasswordRetrievalQuestionPropertyTypeAlias
- /// Part of the standard properties collection.
- ///
- string PasswordQuestion { get; set; }
-
- ///
- /// Gets or sets the Password Answer
- ///
- ///
- /// Alias: umbracoPasswordRetrievalAnswerPropertyTypeAlias
- /// Part of the standard properties collection.
- ///
- string PasswordAnswer { get; set; }
-
- ///
- /// Gets or set the comments for the member
- ///
- ///
- /// Alias: umbracoCommentPropertyTypeAlias
- /// Part of the standard properties collection.
- ///
- string Comments { get; set; }
-
- ///
- /// Gets or sets a boolean indicating whether the Member is approved
- ///
- ///
- /// Alias: umbracoApprovePropertyTypeAlias
- /// Part of the standard properties collection.
- ///
- bool IsApproved { get; set; }
-
- ///
- /// Gets or sets a boolean indicating whether the Member is locked out
- ///
- ///
- /// Alias: umbracoLockPropertyTypeAlias
- /// Part of the standard properties collection.
- ///
- bool IsLockedOut { get; set; }
-
- ///
- /// Gets or sets the date for last login
- ///
- ///
- /// Alias: umbracoLastLoginPropertyTypeAlias
- /// Part of the standard properties collection.
- ///
- DateTime LastLoginDate { get; set; }
-
- ///
- /// Gest or sets the date for last password change
- ///
- ///
- /// Alias: umbracoMemberLastPasswordChange
- /// Part of the standard properties collection.
- ///
- DateTime LastPasswordChangeDate { get; set; }
-
- ///
- /// Gets or sets the date for when Member was locked out
- ///
- ///
- /// Alias: umbracoMemberLastLockout
- /// Part of the standard properties collection.
- ///
- DateTime LastLockoutDate { get; set; }
-
- ///
- /// Gets or sets the number of failed password attempts.
- /// This is the number of times the password was entered incorrectly upon login.
- ///
- ///
- /// Alias: umbracoFailedPasswordAttemptsPropertyTypeAlias
- /// Part of the standard properties collection.
- ///
- int FailedPasswordAttempts { get; set; }
-
- ///
- /// String alias of the default ContentType
- ///
- string ContentTypeAlias { get; }
-
- ///
- /// Gets the ContentType used by this content object
- ///
- IMemberType ContentType { get; }
- }
+using System;
+
+namespace Umbraco.Core.Models
+{
+ public interface IMember : IContentBase
+ {
+ ///
+ /// Gets or sets the Username
+ ///
+ string Username { get; set; }
+
+ ///
+ /// Gets or sets the Email
+ ///
+ string Email { get; set; }
+
+ ///
+ /// Gets or sets the Password
+ ///
+ string Password { get; set; }
+
+ ///
+ /// Gets or sets the Password Question
+ ///
+ ///
+ /// Alias: umbracoPasswordRetrievalQuestionPropertyTypeAlias
+ /// Part of the standard properties collection.
+ ///
+ string PasswordQuestion { get; set; }
+
+ ///
+ /// Gets or sets the Password Answer
+ ///
+ ///
+ /// Alias: umbracoPasswordRetrievalAnswerPropertyTypeAlias
+ /// Part of the standard properties collection.
+ ///
+ string PasswordAnswer { get; set; }
+
+ ///
+ /// Gets or set the comments for the member
+ ///
+ ///
+ /// Alias: umbracoCommentPropertyTypeAlias
+ /// Part of the standard properties collection.
+ ///
+ string Comments { get; set; }
+
+ ///
+ /// Gets or sets a boolean indicating whether the Member is approved
+ ///
+ ///
+ /// Alias: umbracoApprovePropertyTypeAlias
+ /// Part of the standard properties collection.
+ ///
+ bool IsApproved { get; set; }
+
+ ///
+ /// Gets or sets a boolean indicating whether the Member is locked out
+ ///
+ ///
+ /// Alias: umbracoLockPropertyTypeAlias
+ /// Part of the standard properties collection.
+ ///
+ bool IsLockedOut { get; set; }
+
+ ///
+ /// Gets or sets the date for last login
+ ///
+ ///
+ /// Alias: umbracoLastLoginPropertyTypeAlias
+ /// Part of the standard properties collection.
+ ///
+ DateTime LastLoginDate { get; set; }
+
+ ///
+ /// Gest or sets the date for last password change
+ ///
+ ///
+ /// Alias: umbracoMemberLastPasswordChange
+ /// Part of the standard properties collection.
+ ///
+ DateTime LastPasswordChangeDate { get; set; }
+
+ ///
+ /// Gets or sets the date for when Member was locked out
+ ///
+ ///
+ /// Alias: umbracoMemberLastLockout
+ /// Part of the standard properties collection.
+ ///
+ DateTime LastLockoutDate { get; set; }
+
+ ///
+ /// Gets or sets the number of failed password attempts.
+ /// This is the number of times the password was entered incorrectly upon login.
+ ///
+ ///
+ /// Alias: umbracoFailedPasswordAttemptsPropertyTypeAlias
+ /// Part of the standard properties collection.
+ ///
+ int FailedPasswordAttempts { get; set; }
+
+ ///
+ /// String alias of the default ContentType
+ ///
+ string ContentTypeAlias { get; }
+
+ ///
+ /// Gets the ContentType used by this content object
+ ///
+ IMemberType ContentType { get; }
+ }
}
\ No newline at end of file
diff --git a/src/Umbraco.Core/Models/IMemberType.cs b/src/Umbraco.Core/Models/IMemberType.cs
index 8f39e96801..878cc24334 100644
--- a/src/Umbraco.Core/Models/IMemberType.cs
+++ b/src/Umbraco.Core/Models/IMemberType.cs
@@ -1,36 +1,36 @@
-namespace Umbraco.Core.Models
-{
- ///
- /// Defines a MemberType, which Member is based on
- ///
- public interface IMemberType : IContentTypeComposition
- {
- ///
- /// Gets a boolean indicating whether a Property is editable by the Member.
- ///
- /// PropertyType Alias of the Property to check
- ///
- bool MemberCanEditProperty(string propertyTypeAlias);
-
- ///
- /// Gets a boolean indicating whether a Property is visible on the Members profile.
- ///
- /// PropertyType Alias of the Property to check
- ///
- bool MemberCanViewProperty(string propertyTypeAlias);
-
- ///
- /// Sets a boolean indicating whether a Property is editable by the Member.
- ///
- /// PropertyType Alias of the Property to set
- /// Boolean value, true or false
- void SetMemberCanEditProperty(string propertyTypeAlias, bool value);
-
- ///
- /// Sets a boolean indicating whether a Property is visible on the Members profile.
- ///
- /// PropertyType Alias of the Property to set
- /// Boolean value, true or false
- void SetMemberCanViewProperty(string propertyTypeAlias, bool value);
- }
+namespace Umbraco.Core.Models
+{
+ ///
+ /// Defines a MemberType, which Member is based on
+ ///
+ public interface IMemberType : IContentTypeComposition
+ {
+ ///
+ /// Gets a boolean indicating whether a Property is editable by the Member.
+ ///
+ /// PropertyType Alias of the Property to check
+ ///
+ bool MemberCanEditProperty(string propertyTypeAlias);
+
+ ///
+ /// Gets a boolean indicating whether a Property is visible on the Members profile.
+ ///
+ /// PropertyType Alias of the Property to check
+ ///
+ bool MemberCanViewProperty(string propertyTypeAlias);
+
+ ///
+ /// Sets a boolean indicating whether a Property is editable by the Member.
+ ///
+ /// PropertyType Alias of the Property to set
+ /// Boolean value, true or false
+ void SetMemberCanEditProperty(string propertyTypeAlias, bool value);
+
+ ///
+ /// Sets a boolean indicating whether a Property is visible on the Members profile.
+ ///
+ /// PropertyType Alias of the Property to set
+ /// Boolean value, true or false
+ void SetMemberCanViewProperty(string propertyTypeAlias, bool value);
+ }
}
\ No newline at end of file
diff --git a/src/Umbraco.Core/Models/IPublishedProperty.cs b/src/Umbraco.Core/Models/IPublishedProperty.cs
index f6afa1f05e..a50163bc5c 100644
--- a/src/Umbraco.Core/Models/IPublishedProperty.cs
+++ b/src/Umbraco.Core/Models/IPublishedProperty.cs
@@ -1,60 +1,60 @@
-namespace Umbraco.Core.Models
-{
- ///
- /// Represents a property of an IPublishedContent.
- ///
- public interface IPublishedProperty
- {
- ///
- /// Gets the alias of the property.
- ///
- string PropertyTypeAlias { get; }
-
- ///
- /// Gets a value indicating whether the property has a value.
- ///
- ///
- /// This is somewhat implementation-dependent -- depending on whatever IPublishedCache considers
- /// a missing value.
- /// The XmlPublishedCache raw values are strings, and it will consider missing, null or empty (and
- /// that includes whitespace-only) strings as "no value".
- /// Other caches that get their raw value from the database would consider that a property has "no
- /// value" if it is missing, null, or an empty string (including whitespace-only).
- ///
- bool HasValue { get; }
-
- ///
- /// Gets the data value of the property.
- ///
- ///
- /// The data value is whatever was passed to the property when it was instanciated, and it is
- /// somewhat implementation-dependent -- depending on how the IPublishedCache is implemented.
- /// The XmlPublishedCache raw values are strings exclusively since they come from the Xml cache.
- /// For other caches that get their raw value from the database, it would be either a string,
- /// an integer (Int32), or a date and time (DateTime).
- /// If you're using that value, you're probably wrong, unless you're doing some internal
- /// Umbraco stuff.
- ///
- object DataValue { get; }
-
- ///
- /// Gets the object value of the property.
- ///
- ///
- /// The value is what you want to use when rendering content in an MVC view ie in C#.
- /// It can be null, or any type of CLR object.
- /// It has been fully prepared and processed by the appropriate converter.
- ///
- object Value { get; }
-
- ///
- /// Gets the XPath value of the property.
- ///
- ///
- /// The XPath value is what you want to use when navigating content via XPath eg in the XSLT engine.
- /// It must be either null, or a string, or an XPathNavigator.
- /// It has been fully prepared and processed by the appropriate converter.
- ///
- object XPathValue { get; }
- }
+namespace Umbraco.Core.Models
+{
+ ///
+ /// Represents a property of an IPublishedContent.
+ ///
+ public interface IPublishedProperty
+ {
+ ///
+ /// Gets the alias of the property.
+ ///
+ string PropertyTypeAlias { get; }
+
+ ///
+ /// Gets a value indicating whether the property has a value.
+ ///
+ ///
+ /// This is somewhat implementation-dependent -- depending on whatever IPublishedCache considers
+ /// a missing value.
+ /// The XmlPublishedCache raw values are strings, and it will consider missing, null or empty (and
+ /// that includes whitespace-only) strings as "no value".
+ /// Other caches that get their raw value from the database would consider that a property has "no
+ /// value" if it is missing, null, or an empty string (including whitespace-only).
+ ///
+ bool HasValue { get; }
+
+ ///
+ /// Gets the data value of the property.
+ ///
+ ///
+ /// The data value is whatever was passed to the property when it was instanciated, and it is
+ /// somewhat implementation-dependent -- depending on how the IPublishedCache is implemented.
+ /// The XmlPublishedCache raw values are strings exclusively since they come from the Xml cache.
+ /// For other caches that get their raw value from the database, it would be either a string,
+ /// an integer (Int32), or a date and time (DateTime).
+ /// If you're using that value, you're probably wrong, unless you're doing some internal
+ /// Umbraco stuff.
+ ///
+ object DataValue { get; }
+
+ ///
+ /// Gets the object value of the property.
+ ///
+ ///
+ /// The value is what you want to use when rendering content in an MVC view ie in C#.
+ /// It can be null, or any type of CLR object.
+ /// It has been fully prepared and processed by the appropriate converter.
+ ///
+ object Value { get; }
+
+ ///
+ /// Gets the XPath value of the property.
+ ///
+ ///
+ /// The XPath value is what you want to use when navigating content via XPath eg in the XSLT engine.
+ /// It must be either null, or a string, or an XPathNavigator.
+ /// It has been fully prepared and processed by the appropriate converter.
+ ///
+ object XPathValue { get; }
+ }
}
\ No newline at end of file
diff --git a/src/Umbraco.Core/Models/IRelation.cs b/src/Umbraco.Core/Models/IRelation.cs
index b37357f8bc..2c24fdfad3 100644
--- a/src/Umbraco.Core/Models/IRelation.cs
+++ b/src/Umbraco.Core/Models/IRelation.cs
@@ -1,38 +1,38 @@
-using System.Runtime.Serialization;
-using Umbraco.Core.Models.EntityBase;
-
-namespace Umbraco.Core.Models
-{
- public interface IRelation : IAggregateRoot
- {
- ///
- /// Gets or sets the Parent Id of the Relation (Source)
- ///
- [DataMember]
- int ParentId { get; set; }
-
- ///
- /// Gets or sets the Child Id of the Relation (Destination)
- ///
- [DataMember]
- int ChildId { get; set; }
-
- ///
- /// Gets or sets the for the Relation
- ///
- [DataMember]
- IRelationType RelationType { get; set; }
-
- ///
- /// Gets or sets a comment for the Relation
- ///
- [DataMember]
- string Comment { get; set; }
-
- ///
- /// Gets the Id of the that this Relation is based on.
- ///
- [IgnoreDataMember]
- int RelationTypeId { get; }
- }
+using System.Runtime.Serialization;
+using Umbraco.Core.Models.EntityBase;
+
+namespace Umbraco.Core.Models
+{
+ public interface IRelation : IAggregateRoot
+ {
+ ///
+ /// Gets or sets the Parent Id of the Relation (Source)
+ ///
+ [DataMember]
+ int ParentId { get; set; }
+
+ ///
+ /// Gets or sets the Child Id of the Relation (Destination)
+ ///
+ [DataMember]
+ int ChildId { get; set; }
+
+ ///
+ /// Gets or sets the for the Relation
+ ///
+ [DataMember]
+ IRelationType RelationType { get; set; }
+
+ ///
+ /// Gets or sets a comment for the Relation
+ ///
+ [DataMember]
+ string Comment { get; set; }
+
+ ///
+ /// Gets the Id of the that this Relation is based on.
+ ///
+ [IgnoreDataMember]
+ int RelationTypeId { get; }
+ }
}
\ No newline at end of file
diff --git a/src/Umbraco.Core/Models/IRelationType.cs b/src/Umbraco.Core/Models/IRelationType.cs
index 8fc12eb6a1..adb751080e 100644
--- a/src/Umbraco.Core/Models/IRelationType.cs
+++ b/src/Umbraco.Core/Models/IRelationType.cs
@@ -1,41 +1,41 @@
-using System;
-using System.Runtime.Serialization;
-using Umbraco.Core.Models.EntityBase;
-
-namespace Umbraco.Core.Models
-{
- public interface IRelationType : IAggregateRoot
- {
- ///
- /// Gets or sets the Name of the RelationType
- ///
- [DataMember]
- string Name { get; set; }
-
- ///
- /// Gets or sets the Alias of the RelationType
- ///
- [DataMember]
- string Alias { get; set; }
-
- ///
- /// Gets or sets a boolean indicating whether the RelationType is Bidirectional (true) or Parent to Child (false)
- ///
- [DataMember]
- bool IsBidirectional { get; set; }
-
- ///
- /// Gets or sets the Parents object type id
- ///
- /// Corresponds to the NodeObjectType in the umbracoNode table
- [DataMember]
- Guid ParentObjectType { get; set; }
-
- ///
- /// Gets or sets the Childs object type id
- ///
- /// Corresponds to the NodeObjectType in the umbracoNode table
- [DataMember]
- Guid ChildObjectType { get; set; }
- }
+using System;
+using System.Runtime.Serialization;
+using Umbraco.Core.Models.EntityBase;
+
+namespace Umbraco.Core.Models
+{
+ public interface IRelationType : IAggregateRoot
+ {
+ ///
+ /// Gets or sets the Name of the RelationType
+ ///
+ [DataMember]
+ string Name { get; set; }
+
+ ///
+ /// Gets or sets the Alias of the RelationType
+ ///
+ [DataMember]
+ string Alias { get; set; }
+
+ ///
+ /// Gets or sets a boolean indicating whether the RelationType is Bidirectional (true) or Parent to Child (false)
+ ///
+ [DataMember]
+ bool IsBidirectional { get; set; }
+
+ ///
+ /// Gets or sets the Parents object type id
+ ///
+ /// Corresponds to the NodeObjectType in the umbracoNode table
+ [DataMember]
+ Guid ParentObjectType { get; set; }
+
+ ///
+ /// Gets or sets the Childs object type id
+ ///
+ /// Corresponds to the NodeObjectType in the umbracoNode table
+ [DataMember]
+ Guid ChildObjectType { get; set; }
+ }
}
\ No newline at end of file
diff --git a/src/Umbraco.Core/Models/ITag.cs b/src/Umbraco.Core/Models/ITag.cs
index 05990aa6a0..8c1c1aa5e0 100644
--- a/src/Umbraco.Core/Models/ITag.cs
+++ b/src/Umbraco.Core/Models/ITag.cs
@@ -1,17 +1,17 @@
-using System.Runtime.Serialization;
-using Umbraco.Core.Models.EntityBase;
-
-namespace Umbraco.Core.Models
-{
- public interface ITag : IAggregateRoot
- {
- [DataMember]
- string Text { get; set; }
-
- [DataMember]
- string Group { get; set; }
-
- //TODO: enable this at some stage
- //int ParentId { get; set; }
- }
+using System.Runtime.Serialization;
+using Umbraco.Core.Models.EntityBase;
+
+namespace Umbraco.Core.Models
+{
+ public interface ITag : IAggregateRoot
+ {
+ [DataMember]
+ string Text { get; set; }
+
+ [DataMember]
+ string Group { get; set; }
+
+ //TODO: enable this at some stage
+ //int ParentId { get; set; }
+ }
}
\ No newline at end of file
diff --git a/src/Umbraco.Core/Models/Macro.cs b/src/Umbraco.Core/Models/Macro.cs
index a0f0bd9651..914847aea2 100644
--- a/src/Umbraco.Core/Models/Macro.cs
+++ b/src/Umbraco.Core/Models/Macro.cs
@@ -1,403 +1,403 @@
-using System;
-using System.Collections.Generic;
-using System.Collections.ObjectModel;
-using System.Collections.Specialized;
-using System.ComponentModel;
-using System.Linq;
-using System.Reflection;
-using System.Runtime.Serialization;
-using System.Text.RegularExpressions;
-using Umbraco.Core.IO;
-using Umbraco.Core.Models.EntityBase;
-
-namespace Umbraco.Core.Models
-{
- ///
- /// Represents a Macro
- ///
- [Serializable]
- [DataContract(IsReference = true)]
- internal class Macro : Entity, IMacro
- {
- public Macro()
- {
- _properties = new MacroPropertyCollection();
- _properties.CollectionChanged += PropertiesChanged;
- _addedProperties = new List();
- _removedProperties = new List();
- }
-
- ///
- /// Creates an item with pre-filled properties
- ///
- ///
- ///
- ///
- ///
- ///
- ///
- ///
- ///
- ///
- ///
- ///
- ///
- public Macro(int id, bool useInEditor, int cacheDuration, string @alias, string name, string controlType, string controlAssembly, string xsltPath, bool cacheByPage, bool cacheByMember, bool dontRender, string scriptPath)
- : this()
- {
- Id = id;
- UseInEditor = useInEditor;
- CacheDuration = cacheDuration;
- Alias = alias;
- Name = name;
- ControlType = controlType;
- ControlAssembly = controlAssembly;
- XsltPath = xsltPath;
- CacheByPage = cacheByPage;
- CacheByMember = cacheByMember;
- DontRender = dontRender;
- ScriptPath = scriptPath;
- }
-
- ///
- /// Creates an instance for persisting a new item
- ///
- ///
- ///
- ///
- ///
- ///
- ///
- ///
- ///
- ///
- ///
- ///
- public Macro(string @alias, string name,
- string controlType = "",
- string controlAssembly = "",
- string xsltPath = "",
- string scriptPath = "",
- bool cacheByPage = false,
- bool cacheByMember = false,
- bool dontRender = true,
- bool useInEditor = false,
- int cacheDuration = 0)
- : this()
- {
- UseInEditor = useInEditor;
- CacheDuration = cacheDuration;
- Alias = alias;
- Name = name;
- ControlType = controlType;
- ControlAssembly = controlAssembly;
- XsltPath = xsltPath;
- CacheByPage = cacheByPage;
- CacheByMember = cacheByMember;
- DontRender = dontRender;
- ScriptPath = scriptPath;
- }
-
- private string _alias;
- private string _name;
- private bool _useInEditor;
- private int _cacheDuration;
- private bool _cacheByPage;
- private bool _cacheByMember;
- private bool _dontRender;
- private string _scriptFile;
- private string _scriptAssembly;
- private string _python;
- private string _xslt;
- private readonly MacroPropertyCollection _properties;
- private readonly List _addedProperties;
- private readonly List _removedProperties;
-
- private static readonly PropertyInfo AliasSelector = ExpressionHelper.GetPropertyInfo(x => x.Alias);
- private static readonly PropertyInfo NameSelector = ExpressionHelper.GetPropertyInfo(x => x.Name);
- private static readonly PropertyInfo UseInEditorSelector = ExpressionHelper.GetPropertyInfo(x => x.UseInEditor);
- private static readonly PropertyInfo CacheDurationSelector = ExpressionHelper.GetPropertyInfo(x => x.CacheDuration);
- private static readonly PropertyInfo CacheByPageSelector = ExpressionHelper.GetPropertyInfo(x => x.CacheByPage);
- private static readonly PropertyInfo CacheByMemberSelector = ExpressionHelper.GetPropertyInfo(x => x.CacheByMember);
- private static readonly PropertyInfo DontRenderSelector = ExpressionHelper.GetPropertyInfo(x => x.DontRender);
- private static readonly PropertyInfo ControlPathSelector = ExpressionHelper.GetPropertyInfo(x => x.ControlType);
- private static readonly PropertyInfo ControlAssemblySelector = ExpressionHelper.GetPropertyInfo(x => x.ControlAssembly);
- private static readonly PropertyInfo ScriptPathSelector = ExpressionHelper.GetPropertyInfo(x => x.ScriptPath);
- private static readonly PropertyInfo XsltPathSelector = ExpressionHelper.GetPropertyInfo(x => x.XsltPath);
- private static readonly PropertyInfo PropertiesSelector = ExpressionHelper.GetPropertyInfo(x => x.Properties);
-
- void PropertiesChanged(object sender, NotifyCollectionChangedEventArgs e)
- {
- OnPropertyChanged(PropertiesSelector);
-
- if (e.Action == NotifyCollectionChangedAction.Add)
- {
- //listen for changes
- var prop = e.NewItems.Cast().First();
- prop.PropertyChanged += PropertyDataChanged;
-
- var alias = prop.Alias;
-
- //remove from the removed/added props (since people could add/remove all they want in one request)
- _removedProperties.RemoveAll(s => s == alias);
- _addedProperties.RemoveAll(s => s == alias);
-
- //add to the added props
- _addedProperties.Add(alias);
- }
- else if (e.Action == NotifyCollectionChangedAction.Remove)
- {
- //remove listening for changes
- var prop = e.OldItems.Cast().First();
- prop.PropertyChanged -= PropertyDataChanged;
-
- var alias = prop.Alias;
-
- //remove from the removed/added props (since people could add/remove all they want in one request)
- _removedProperties.RemoveAll(s => s == alias);
- _addedProperties.RemoveAll(s => s == alias);
-
- //add to the added props
- _removedProperties.Add(alias);
- }
- }
-
- ///
- /// When some data of a property has changed ensure our Properties flag is dirty
- ///
- ///
- ///
- void PropertyDataChanged(object sender, PropertyChangedEventArgs e)
- {
- OnPropertyChanged(PropertiesSelector);
- }
-
- public override void ResetDirtyProperties(bool rememberPreviouslyChangedProperties)
- {
- _addedProperties.Clear();
- _removedProperties.Clear();
- base.ResetDirtyProperties(rememberPreviouslyChangedProperties);
- foreach (var prop in Properties)
- {
- ((TracksChangesEntityBase)prop).ResetDirtyProperties(rememberPreviouslyChangedProperties);
- }
- }
-
- ///
- /// Used internally to check if we need to add a section in the repository to the db
- ///
- internal IEnumerable AddedProperties
- {
- get { return _addedProperties; }
- }
-
- ///
- /// Used internally to check if we need to remove a section in the repository to the db
- ///
- internal IEnumerable RemovedProperties
- {
- get { return _removedProperties; }
- }
-
- ///
- /// Gets or sets the alias of the Macro
- ///
- [DataMember]
- public string Alias
- {
- get { return _alias; }
- set
- {
- SetPropertyValueAndDetectChanges(o =>
- {
- _alias = value;
- return _alias;
- }, _alias, AliasSelector);
- }
- }
-
- ///
- /// Gets or sets the name of the Macro
- ///
- [DataMember]
- public string Name
- {
- get { return _name; }
- set
- {
- SetPropertyValueAndDetectChanges(o =>
- {
- _name = value;
- return _name;
- }, _name, NameSelector);
- }
- }
-
- ///
- /// Gets or sets a boolean indicating whether the Macro can be used in an Editor
- ///
- [DataMember]
- public bool UseInEditor
- {
- get { return _useInEditor; }
- set
- {
- SetPropertyValueAndDetectChanges(o =>
- {
- _useInEditor = value;
- return _useInEditor;
- }, _useInEditor, UseInEditorSelector);
- }
- }
-
- ///
- /// Gets or sets the Cache Duration for the Macro
- ///
- [DataMember]
- public int CacheDuration
- {
- get { return _cacheDuration; }
- set
- {
- SetPropertyValueAndDetectChanges(o =>
- {
- _cacheDuration = value;
- return _cacheDuration;
- }, _cacheDuration, CacheDurationSelector);
- }
- }
-
- ///
- /// Gets or sets a boolean indicating whether the Macro should be Cached by Page
- ///
- [DataMember]
- public bool CacheByPage
- {
- get { return _cacheByPage; }
- set
- {
- SetPropertyValueAndDetectChanges(o =>
- {
- _cacheByPage = value;
- return _cacheByPage;
- }, _cacheByPage, CacheByPageSelector);
- }
- }
-
- ///
- /// Gets or sets a boolean indicating whether the Macro should be Cached Personally
- ///
- [DataMember]
- public bool CacheByMember
- {
- get { return _cacheByMember; }
- set
- {
- SetPropertyValueAndDetectChanges(o =>
- {
- _cacheByMember = value;
- return _cacheByMember;
- }, _cacheByMember, CacheByMemberSelector);
- }
- }
-
- ///
- /// Gets or sets a boolean indicating whether the Macro should be rendered in an Editor
- ///
- [DataMember]
- public bool DontRender
- {
- get { return _dontRender; }
- set
- {
- SetPropertyValueAndDetectChanges(o =>
- {
- _dontRender = value;
- return _dontRender;
- }, _dontRender, DontRenderSelector);
- }
- }
-
- ///
- /// Gets or sets the path to user control or the Control Type to render
- ///
- [DataMember]
- public string ControlType
- {
- get { return _scriptFile; }
- set
- {
- SetPropertyValueAndDetectChanges(o =>
- {
- _scriptFile = value;
- return _scriptFile;
- }, _scriptFile, ControlPathSelector);
- }
- }
-
- ///
- /// Gets or sets the name of the assembly, which should be used by the Macro
- ///
- /// Will usually only be filled if the ControlType is a Usercontrol
- [DataMember]
- public string ControlAssembly
- {
- get { return _scriptAssembly; }
- set
- {
- SetPropertyValueAndDetectChanges(o =>
- {
- _scriptAssembly = value;
- return _scriptAssembly;
- }, _scriptAssembly, ControlAssemblySelector);
- }
- }
-
- ///
- /// Gets or set the path to the Python file in use
- ///
- /// Optional: Can only be one of three Script, Python or Xslt
- [DataMember]
- public string ScriptPath
- {
- get { return _python; }
- set
- {
- SetPropertyValueAndDetectChanges(o =>
- {
- _python = value;
- return _python;
- }, _python, ScriptPathSelector);
- }
- }
-
- ///
- /// Gets or sets the path to the Xslt file in use
- ///
- /// Optional: Can only be one of three Script, Python or Xslt
- [DataMember]
- public string XsltPath
- {
- get { return _xslt; }
- set
- {
- SetPropertyValueAndDetectChanges(o =>
- {
- _xslt = value;
- return _xslt;
- }, _xslt, XsltPathSelector);
- }
- }
-
- ///
- /// Gets or sets a list of Macro Properties
- ///
- [DataMember]
- public MacroPropertyCollection Properties
- {
- get { return _properties; }
- }
-
-
- }
+using System;
+using System.Collections.Generic;
+using System.Collections.ObjectModel;
+using System.Collections.Specialized;
+using System.ComponentModel;
+using System.Linq;
+using System.Reflection;
+using System.Runtime.Serialization;
+using System.Text.RegularExpressions;
+using Umbraco.Core.IO;
+using Umbraco.Core.Models.EntityBase;
+
+namespace Umbraco.Core.Models
+{
+ ///
+ /// Represents a Macro
+ ///
+ [Serializable]
+ [DataContract(IsReference = true)]
+ internal class Macro : Entity, IMacro
+ {
+ public Macro()
+ {
+ _properties = new MacroPropertyCollection();
+ _properties.CollectionChanged += PropertiesChanged;
+ _addedProperties = new List();
+ _removedProperties = new List();
+ }
+
+ ///
+ /// Creates an item with pre-filled properties
+ ///
+ ///
+ ///
+ ///
+ ///
+ ///
+ ///
+ ///
+ ///
+ ///
+ ///
+ ///
+ ///
+ public Macro(int id, bool useInEditor, int cacheDuration, string @alias, string name, string controlType, string controlAssembly, string xsltPath, bool cacheByPage, bool cacheByMember, bool dontRender, string scriptPath)
+ : this()
+ {
+ Id = id;
+ UseInEditor = useInEditor;
+ CacheDuration = cacheDuration;
+ Alias = alias;
+ Name = name;
+ ControlType = controlType;
+ ControlAssembly = controlAssembly;
+ XsltPath = xsltPath;
+ CacheByPage = cacheByPage;
+ CacheByMember = cacheByMember;
+ DontRender = dontRender;
+ ScriptPath = scriptPath;
+ }
+
+ ///
+ /// Creates an instance for persisting a new item
+ ///
+ ///
+ ///
+ ///
+ ///
+ ///
+ ///
+ ///
+ ///
+ ///
+ ///
+ ///
+ public Macro(string @alias, string name,
+ string controlType = "",
+ string controlAssembly = "",
+ string xsltPath = "",
+ string scriptPath = "",
+ bool cacheByPage = false,
+ bool cacheByMember = false,
+ bool dontRender = true,
+ bool useInEditor = false,
+ int cacheDuration = 0)
+ : this()
+ {
+ UseInEditor = useInEditor;
+ CacheDuration = cacheDuration;
+ Alias = alias;
+ Name = name;
+ ControlType = controlType;
+ ControlAssembly = controlAssembly;
+ XsltPath = xsltPath;
+ CacheByPage = cacheByPage;
+ CacheByMember = cacheByMember;
+ DontRender = dontRender;
+ ScriptPath = scriptPath;
+ }
+
+ private string _alias;
+ private string _name;
+ private bool _useInEditor;
+ private int _cacheDuration;
+ private bool _cacheByPage;
+ private bool _cacheByMember;
+ private bool _dontRender;
+ private string _scriptFile;
+ private string _scriptAssembly;
+ private string _python;
+ private string _xslt;
+ private readonly MacroPropertyCollection _properties;
+ private readonly List _addedProperties;
+ private readonly List _removedProperties;
+
+ private static readonly PropertyInfo AliasSelector = ExpressionHelper.GetPropertyInfo(x => x.Alias);
+ private static readonly PropertyInfo NameSelector = ExpressionHelper.GetPropertyInfo(x => x.Name);
+ private static readonly PropertyInfo UseInEditorSelector = ExpressionHelper.GetPropertyInfo(x => x.UseInEditor);
+ private static readonly PropertyInfo CacheDurationSelector = ExpressionHelper.GetPropertyInfo(x => x.CacheDuration);
+ private static readonly PropertyInfo CacheByPageSelector = ExpressionHelper.GetPropertyInfo(x => x.CacheByPage);
+ private static readonly PropertyInfo CacheByMemberSelector = ExpressionHelper.GetPropertyInfo(x => x.CacheByMember);
+ private static readonly PropertyInfo DontRenderSelector = ExpressionHelper.GetPropertyInfo(x => x.DontRender);
+ private static readonly PropertyInfo ControlPathSelector = ExpressionHelper.GetPropertyInfo(x => x.ControlType);
+ private static readonly PropertyInfo ControlAssemblySelector = ExpressionHelper.GetPropertyInfo(x => x.ControlAssembly);
+ private static readonly PropertyInfo ScriptPathSelector = ExpressionHelper.GetPropertyInfo(x => x.ScriptPath);
+ private static readonly PropertyInfo XsltPathSelector = ExpressionHelper.GetPropertyInfo