-Cleaned up preprocessor symbols
This commit is contained in:
@@ -58,7 +58,7 @@ namespace Newtonsoft.Json.Utilities
|
||||
#endif
|
||||
}
|
||||
|
||||
#if !(PORTABLE40 || PORTABLE)
|
||||
#if !(PORTABLE)
|
||||
public static XmlDateTimeSerializationMode ToSerializationMode(DateTimeKind kind)
|
||||
{
|
||||
switch (kind)
|
||||
|
||||
@@ -43,7 +43,7 @@ using Newtonsoft.Json.Serialization;
|
||||
|
||||
namespace Newtonsoft.Json.Utilities
|
||||
{
|
||||
#if (DOTNET || PORTABLE || PORTABLE40)
|
||||
#if (DOTNET || PORTABLE)
|
||||
internal enum MemberTypes
|
||||
{
|
||||
Property = 0,
|
||||
@@ -790,13 +790,11 @@ namespace Newtonsoft.Json.Utilities
|
||||
return (attributeType != null) ? Attribute.GetCustomAttributes(mi, attributeType, inherit) : Attribute.GetCustomAttributes(mi, inherit);
|
||||
}
|
||||
|
||||
#if !PORTABLE40
|
||||
Module m = provider as Module;
|
||||
if (m != null)
|
||||
{
|
||||
return (attributeType != null) ? Attribute.GetCustomAttributes(m, attributeType, inherit) : Attribute.GetCustomAttributes(m, inherit);
|
||||
}
|
||||
#endif
|
||||
|
||||
ParameterInfo p = provider as ParameterInfo;
|
||||
if (p != null)
|
||||
@@ -804,14 +802,10 @@ namespace Newtonsoft.Json.Utilities
|
||||
return (attributeType != null) ? Attribute.GetCustomAttributes(p, attributeType, inherit) : Attribute.GetCustomAttributes(p, inherit);
|
||||
}
|
||||
|
||||
#if !PORTABLE40
|
||||
ICustomAttributeProvider customAttributeProvider = (ICustomAttributeProvider)attributeProvider;
|
||||
object[] result = (attributeType != null) ? customAttributeProvider.GetCustomAttributes(attributeType, inherit) : customAttributeProvider.GetCustomAttributes(inherit);
|
||||
|
||||
return (Attribute[])result;
|
||||
#else
|
||||
throw new Exception("Cannot get attributes from '{0}'.".FormatWith(CultureInfo.InvariantCulture, provider));
|
||||
#endif
|
||||
}
|
||||
#else
|
||||
public static T[] GetAttributes<T>(object attributeProvider, bool inherit) where T : Attribute
|
||||
|
||||
@@ -107,7 +107,7 @@ namespace Newtonsoft.Json.Utilities
|
||||
|
||||
public static MemberTypes MemberType(this MemberInfo memberInfo)
|
||||
{
|
||||
#if !(DOTNET || PORTABLE || PORTABLE40)
|
||||
#if !(DOTNET || PORTABLE)
|
||||
return memberInfo.MemberType;
|
||||
#else
|
||||
if (memberInfo is PropertyInfo)
|
||||
@@ -214,7 +214,7 @@ namespace Newtonsoft.Json.Utilities
|
||||
#endif
|
||||
}
|
||||
|
||||
#if (PORTABLE40 || DOTNET || PORTABLE)
|
||||
#if (DOTNET || PORTABLE)
|
||||
public static PropertyInfo GetProperty(this Type type, string name, BindingFlags bindingFlags, object placeholder1, Type propertyType, IList<Type> indexParameters, object placeholder2)
|
||||
{
|
||||
IEnumerable<PropertyInfo> propertyInfos = type.GetProperties(bindingFlags);
|
||||
|
||||
Reference in New Issue
Block a user