Removes lots of Dead Code - thanks NDepend!

This commit is contained in:
Shannon
2016-03-23 10:58:06 +01:00
parent fb104004e0
commit 7d3ba43816
29 changed files with 12 additions and 807 deletions

View File

@@ -1,32 +0,0 @@
using System;
using System.ComponentModel;
namespace Umbraco.Core.Configuration.UmbracoSettings
{
/// <summary>
/// Allows for converting string representations of 0 and 1 to boolean
/// </summary>
internal class CustomBooleanTypeConverter : BooleanConverter
{
public override bool CanConvertFrom(ITypeDescriptorContext context, Type sourceType)
{
if (sourceType == typeof(string))
{
return true;
}
return base.CanConvertFrom(context, sourceType);
}
public override object ConvertFrom(ITypeDescriptorContext context, System.Globalization.CultureInfo culture, object value)
{
if (value is string)
{
var str = (string)value;
if (str == "1") return true;
if (str == "0" || str == "") return false;
}
return base.ConvertFrom(context, culture, value);
}
}
}

View File

@@ -1,62 +0,0 @@
using System.Configuration;
namespace Umbraco.Core.Configuration.UmbracoSettings
{
internal class LinkElement : ConfigurationElement, ILink
{
[ConfigurationProperty("application")]
internal string Application
{
get { return (string)base["application"]; }
}
[ConfigurationProperty("applicationUrl")]
internal string ApplicationUrl
{
get { return (string)base["applicationUrl"]; }
}
[ConfigurationProperty("language")]
internal string Language
{
get { return (string)base["language"]; }
}
[ConfigurationProperty("userType")]
internal string UserType
{
get { return (string)base["userType"]; }
}
[ConfigurationProperty("helpUrl")]
internal string HelpUrl
{
get { return (string)base["helpUrl"]; }
}
string ILink.Application
{
get { return Application; }
}
string ILink.ApplicationUrl
{
get { return ApplicationUrl; }
}
string ILink.Language
{
get { return Language; }
}
string ILink.UserType
{
get { return UserType; }
}
string ILink.HelpUrl
{
get { return HelpUrl; }
}
}
}

View File

@@ -1,34 +0,0 @@
using System.Collections.Generic;
using System.Configuration;
namespace Umbraco.Core.Configuration.UmbracoSettings
{
internal class LinksCollection : ConfigurationElementCollection, IEnumerable<ILink>
{
protected override ConfigurationElement CreateNewElement()
{
return new LinkElement();
}
protected override object GetElementKey(ConfigurationElement element)
{
return ((LinkElement)element).Application
+ ((LinkElement)element).ApplicationUrl
+ ((LinkElement)element).Language
+ ((LinkElement)element).UserType;
}
IEnumerator<ILink> IEnumerable<ILink>.GetEnumerator()
{
for (var i = 0; i < Count; i++)
{
yield return BaseGet(i) as ILink;
}
}
System.Collections.IEnumerator System.Collections.IEnumerable.GetEnumerator()
{
return GetEnumerator();
}
}
}