Imported Upstream version 5.2.0.175

Former-commit-id: bb0468d0f257ff100aa895eb5fe583fb5dfbf900
This commit is contained in:
Xamarin Public Jenkins (auto-signing)
2017-06-07 13:16:24 +00:00
parent 4bdbaf4a88
commit 966bba02bb
8776 changed files with 346420 additions and 149650 deletions

View File

@@ -1,7 +1,6 @@
Microsoft Visual Studio Solution File, Format Version 12.00
# Visual Studio 2013
VisualStudioVersion = 12.0.30723.0
# Visual Studio 14
VisualStudioVersion = 14.0.25420.1
MinimumVisualStudioVersion = 10.0.40219.1
Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "System.ComponentModel.Annotations.Tests", "tests\System.ComponentModel.Annotations.Tests.csproj", "{6E48765E-D6AC-4A79-9C2E-B5EE67EEDECF}"
ProjectSection(ProjectDependencies) = postProject
@@ -9,38 +8,43 @@ Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "System.ComponentModel.Annot
EndProjectSection
EndProject
Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "System.ComponentModel.Annotations", "src\System.ComponentModel.Annotations.csproj", "{4266D58F-EB60-46C2-BA81-3ABDE759A7D5}"
EndProject
Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = ".nuget", ".nuget", "{3A3E1C22-FF83-4D70-A94A-6C130805E6BF}"
ProjectSection(SolutionItems) = preProject
..\.nuget\packages.Windows_NT.config = ..\.nuget\packages.Windows_NT.config
ProjectSection(ProjectDependencies) = postProject
{C4D6F1F4-DC7E-4756-9A88-171A8B1F1E26} = {C4D6F1F4-DC7E-4756-9A88-171A8B1F1E26}
EndProjectSection
EndProject
Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "System.ComponentModel.Annotations", "ref\System.ComponentModel.Annotations.csproj", "{C4D6F1F4-DC7E-4756-9A88-171A8B1F1E26}"
EndProject
Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "tests", "tests", "{1A2F9F4A-A032-433E-B914-ADD5992BB178}"
EndProject
Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "src", "src", "{E107E9C1-E893-4E87-987E-04EF0DCEAEFD}"
EndProject
Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "ref", "ref", "{2E666815-2EDB-464B-9DF6-380BF4789AD4}"
EndProject
Global
GlobalSection(SolutionConfigurationPlatforms) = preSolution
DebugNETCoreAppnet463-Windows_NTnetstandard|AnyCPU = DebugNETCoreAppnet463-Windows_NTnetstandard|AnyCPU
ReleaseNETCoreAppnet463-Windows_NTnetstandard|AnyCPU = ReleaseNETCoreAppnet463-Windows_NTnetstandard|AnyCPU
DebugNETCoreAppnetstandardnetstandard|AnyCPU = DebugNETCoreAppnetstandardnetstandard|AnyCPU
ReleaseNETCoreAppnetstandardnetstandard|AnyCPU = ReleaseNETCoreAppnetstandardnetstandard|AnyCPU
Debug|Any CPU = Debug|Any CPU
Release|Any CPU = Release|Any CPU
EndGlobalSection
GlobalSection(ProjectConfigurationPlatforms) = postSolution
{6E48765E-D6AC-4A79-9C2E-B5EE67EEDECF}.DebugNETCoreAppnet463-Windows_NTnetstandard|AnyCPU.ActiveCfg = netstandard-Debug|Any CPU
{6E48765E-D6AC-4A79-9C2E-B5EE67EEDECF}.DebugNETCoreAppnet463-Windows_NTnetstandard|AnyCPU.Build.0 = netstandard-Debug|Any CPU
{6E48765E-D6AC-4A79-9C2E-B5EE67EEDECF}.ReleaseNETCoreAppnet463-Windows_NTnetstandard|AnyCPU.ActiveCfg = netstandard-Release|Any CPU
{6E48765E-D6AC-4A79-9C2E-B5EE67EEDECF}.ReleaseNETCoreAppnet463-Windows_NTnetstandard|AnyCPU.Build.0 = netstandard-Release|Any CPU
{6E48765E-D6AC-4A79-9C2E-B5EE67EEDECF}.DebugNETCoreAppnetstandardnetstandard|AnyCPU.ActiveCfg = netstandard-Debug|Any CPU
{6E48765E-D6AC-4A79-9C2E-B5EE67EEDECF}.DebugNETCoreAppnetstandardnetstandard|AnyCPU.Build.0 = netstandard-Debug|Any CPU
{6E48765E-D6AC-4A79-9C2E-B5EE67EEDECF}.ReleaseNETCoreAppnetstandardnetstandard|AnyCPU.ActiveCfg = netstandard-Release|Any CPU
{6E48765E-D6AC-4A79-9C2E-B5EE67EEDECF}.ReleaseNETCoreAppnetstandardnetstandard|AnyCPU.Build.0 = netstandard-Release|Any CPU
{4266D58F-EB60-46C2-BA81-3ABDE759A7D5}.DebugNETCoreAppnet463-Windows_NTnetstandard|AnyCPU.ActiveCfg = net463-Windows_NT-Debug|Any CPU
{4266D58F-EB60-46C2-BA81-3ABDE759A7D5}.DebugNETCoreAppnet463-Windows_NTnetstandard|AnyCPU.Build.0 = net463-Windows_NT-Debug|Any CPU
{4266D58F-EB60-46C2-BA81-3ABDE759A7D5}.ReleaseNETCoreAppnet463-Windows_NTnetstandard|AnyCPU.ActiveCfg = net463-Windows_NT-Release|Any CPU
{4266D58F-EB60-46C2-BA81-3ABDE759A7D5}.ReleaseNETCoreAppnet463-Windows_NTnetstandard|AnyCPU.Build.0 = net463-Windows_NT-Release|Any CPU
{4266D58F-EB60-46C2-BA81-3ABDE759A7D5}.DebugNETCoreAppnetstandardnetstandard|AnyCPU.ActiveCfg = netstandard-Debug|Any CPU
{4266D58F-EB60-46C2-BA81-3ABDE759A7D5}.DebugNETCoreAppnetstandardnetstandard|AnyCPU.Build.0 = netstandard-Debug|Any CPU
{4266D58F-EB60-46C2-BA81-3ABDE759A7D5}.ReleaseNETCoreAppnetstandardnetstandard|AnyCPU.ActiveCfg = netstandard-Release|Any CPU
{4266D58F-EB60-46C2-BA81-3ABDE759A7D5}.ReleaseNETCoreAppnetstandardnetstandard|AnyCPU.Build.0 = netstandard-Release|Any CPU
{6E48765E-D6AC-4A79-9C2E-B5EE67EEDECF}.Debug|Any CPU.ActiveCfg = netstandard-Debug|Any CPU
{6E48765E-D6AC-4A79-9C2E-B5EE67EEDECF}.Debug|Any CPU.Build.0 = netstandard-Debug|Any CPU
{6E48765E-D6AC-4A79-9C2E-B5EE67EEDECF}.Release|Any CPU.ActiveCfg = netstandard-Release|Any CPU
{6E48765E-D6AC-4A79-9C2E-B5EE67EEDECF}.Release|Any CPU.Build.0 = netstandard-Release|Any CPU
{4266D58F-EB60-46C2-BA81-3ABDE759A7D5}.Debug|Any CPU.ActiveCfg = netstandard-Debug|Any CPU
{4266D58F-EB60-46C2-BA81-3ABDE759A7D5}.Debug|Any CPU.Build.0 = netstandard-Debug|Any CPU
{4266D58F-EB60-46C2-BA81-3ABDE759A7D5}.Release|Any CPU.ActiveCfg = netstandard-Release|Any CPU
{4266D58F-EB60-46C2-BA81-3ABDE759A7D5}.Release|Any CPU.Build.0 = netstandard-Release|Any CPU
{C4D6F1F4-DC7E-4756-9A88-171A8B1F1E26}.Debug|Any CPU.ActiveCfg = netstandard-Debug|Any CPU
{C4D6F1F4-DC7E-4756-9A88-171A8B1F1E26}.Debug|Any CPU.Build.0 = netstandard-Debug|Any CPU
{C4D6F1F4-DC7E-4756-9A88-171A8B1F1E26}.Release|Any CPU.ActiveCfg = netstandard-Release|Any CPU
{C4D6F1F4-DC7E-4756-9A88-171A8B1F1E26}.Release|Any CPU.Build.0 = netstandard-Release|Any CPU
EndGlobalSection
GlobalSection(SolutionProperties) = preSolution
HideSolutionNode = FALSE
EndGlobalSection
GlobalSection(NestedProjects) = preSolution
{6E48765E-D6AC-4A79-9C2E-B5EE67EEDECF} = {1A2F9F4A-A032-433E-B914-ADD5992BB178}
{4266D58F-EB60-46C2-BA81-3ABDE759A7D5} = {E107E9C1-E893-4E87-987E-04EF0DCEAEFD}
{C4D6F1F4-DC7E-4756-9A88-171A8B1F1E26} = {2E666815-2EDB-464B-9DF6-380BF4789AD4}
EndGlobalSection
EndGlobal

View File

@@ -4,5 +4,7 @@
<PropertyGroup>
<AssemblyVersion>4.2.0.0</AssemblyVersion>
<IsNETCoreApp>true</IsNETCoreApp>
<IsDesktopFacade>true</IsDesktopFacade>
<IsUAP>true</IsUAP>
</PropertyGroup>
</Project>

View File

@@ -1,8 +0,0 @@
<?xml version="1.0" encoding="utf-8"?>
<Project ToolsVersion="14.0" DefaultTargets="Build" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
<Import Project="$([MSBuild]::GetDirectoryNameOfFileAbove($(MSBuildThisFileDirectory), dir.props))\dir.props" />
<ItemGroup>
<Project Include="System.ComponentModel.Annotations.pkgproj" />
</ItemGroup>
<Import Project="$([MSBuild]::GetDirectoryNameOfFileAbove($(MSBuildThisFileDirectory), dir.traversal.targets))\dir.traversal.targets" />
</Project>

View File

@@ -5,7 +5,7 @@
<ProjectReference Include="..\ref\System.ComponentModel.Annotations.csproj">
<SupportedFramework>net463;netcoreapp2.0;$(AllXamarinFrameworks)</SupportedFramework>
</ProjectReference>
<ProjectReference Include="..\src\System.ComponentModel.Annotations.builds" />
<ProjectReference Include="..\src\System.ComponentModel.Annotations.csproj" />
<InboxOnTargetFramework Include="MonoAndroid10" />
<InboxOnTargetFramework Include="MonoTouch10" />
<InboxOnTargetFramework Include="net45">

View File

@@ -1,6 +1,9 @@
<?xml version="1.0" encoding="utf-8"?>
<Project ToolsVersion="14.0" DefaultTargets="Build" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
<Import Project="$([MSBuild]::GetDirectoryNameOfFileAbove($(MSBuildThisFileDirectory), dir.props))\dir.props" />
<PropertyGroup>
<ProjectGuid>{C4D6F1F4-DC7E-4756-9A88-171A8B1F1E26}</ProjectGuid>
</PropertyGroup>
<PropertyGroup Condition="'$(Configuration)|$(Platform)' == 'netstandard-Debug|AnyCPU'" />
<PropertyGroup Condition="'$(Configuration)|$(Platform)' == 'netstandard-Release|AnyCPU'" />
<ItemGroup>

View File

@@ -2,7 +2,7 @@
<Project ToolsVersion="14.0" DefaultTargets="Build" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
<PropertyGroup>
<BuildConfigurations>
net463-Windows_NT;
netfx;
netstandard;
</BuildConfigurations>
</PropertyGroup>

View File

@@ -1,64 +1,5 @@
<?xml version="1.0" encoding="utf-8"?>
<root>
<!--
Microsoft ResX Schema
Version 2.0
The primary goals of this format is to allow a simple XML format
that is mostly human readable. The generation and parsing of the
various data types are done through the TypeConverter classes
associated with the data types.
Example:
... ado.net/XML headers & schema ...
<resheader name="resmimetype">text/microsoft-resx</resheader>
<resheader name="version">2.0</resheader>
<resheader name="reader">System.Resources.ResXResourceReader, System.Windows.Forms, ...</resheader>
<resheader name="writer">System.Resources.ResXResourceWriter, System.Windows.Forms, ...</resheader>
<data name="Name1"><value>this is my long string</value><comment>this is a comment</comment></data>
<data name="Color1" type="System.Drawing.Color, System.Drawing">Blue</data>
<data name="Bitmap1" mimetype="application/x-microsoft.net.object.binary.base64">
<value>[base64 mime encoded serialized .NET Framework object]</value>
</data>
<data name="Icon1" type="System.Drawing.Icon, System.Drawing" mimetype="application/x-microsoft.net.object.bytearray.base64">
<value>[base64 mime encoded string representing a byte array form of the .NET Framework object]</value>
<comment>This is a comment</comment>
</data>
There are any number of "resheader" rows that contain simple
name/value pairs.
Each data row contains a name, and value. The row also contains a
type or mimetype. Type corresponds to a .NET class that support
text/value conversion through the TypeConverter architecture.
Classes that don't support this are serialized and stored with the
mimetype set.
The mimetype is used for serialized objects, and tells the
ResXResourceReader how to depersist the object. This is currently not
extensible. For a given mimetype the value must be set accordingly:
Note - application/x-microsoft.net.object.binary.base64 is the format
that the ResXResourceWriter will generate, however the reader can
read any of the formats listed below.
mimetype: application/x-microsoft.net.object.binary.base64
value : The object must be serialized with
: System.Runtime.Serialization.Formatters.Binary.BinaryFormatter
: and then encoded with base64 encoding.
mimetype: application/x-microsoft.net.object.soap.base64
value : The object must be serialized with
: System.Runtime.Serialization.Formatters.Soap.SoapFormatter
: and then encoded with base64 encoding.
mimetype: application/x-microsoft.net.object.bytearray.base64
value : The object must be serialized into a byte array
: using a System.ComponentModel.TypeConverter
: and then encoded with base64 encoding.
-->
<xsd:schema id="root" xmlns="" xmlns:xsd="http://www.w3.org/2001/XMLSchema" xmlns:msdata="urn:schemas-microsoft-com:xml-msdata">
<xsd:import namespace="http://www.w3.org/XML/1998/namespace" />
<xsd:element name="root" msdata:IsDataSet="true">
@@ -118,23 +59,11 @@
<value>System.Resources.ResXResourceWriter, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089</value>
</resheader>
<data name="ArgumentIsNullOrWhitespace" xml:space="preserve">
<value>The argument '{0}' cannot be null, empty or contain only white space.</value>
</data>
<data name="AssociatedMetadataTypeTypeDescriptor_MetadataTypeContainsUnknownProperties" xml:space="preserve">
<value>The associated metadata type for type '{0}' contains the following unknown properties or fields: {1}. Please make sure that the names of these members match the names of the properties on the main type.</value>
</data>
<data name="AttributeStore_Type_Must_Be_Public" xml:space="preserve">
<value>The type '{0}' must be public.</value>
</data>
<data name="AttributeStore_Unknown_Method" xml:space="preserve">
<value>The type '{0}' does not contain a public method named '{1}'.</value>
<value>The argument '{0}' cannot be null, empty or contain only whitespace.</value>
</data>
<data name="AttributeStore_Unknown_Property" xml:space="preserve">
<value>The type '{0}' does not contain a public property named '{1}'.</value>
</data>
<data name="Common_NullOrEmpty" xml:space="preserve">
<value>Value cannot be null or empty.</value>
</data>
<data name="Common_PropertyNotFound" xml:space="preserve">
<value>The property {0}.{1} could not be found.</value>
</data>
@@ -198,9 +127,6 @@
<data name="MaxLengthAttribute_ValidationError" xml:space="preserve">
<value>The field {0} must be a string or array type with a maximum length of '{1}'.</value>
</data>
<data name="MetadataTypeAttribute_TypeCannotBeNull" xml:space="preserve">
<value>MetadataClassType cannot be null.</value>
</data>
<data name="MinLengthAttribute_InvalidMinLength" xml:space="preserve">
<value>MinLengthAttribute must have a Length value that is zero or greater.</value>
</data>
@@ -276,16 +202,10 @@
<data name="ValidationAttribute_ValidationError" xml:space="preserve">
<value>The field {0} is invalid.</value>
</data>
<data name="ValidationContext_Must_Be_Method" xml:space="preserve">
<value>The ValidationContext for the type '{0}', member name '{1}' must provide the MethodInfo.</value>
</data>
<data name="ValidationContextServiceContainer_ItemAlreadyExists" xml:space="preserve">
<value>A service of type '{0}' already exists in the container.</value>
</data>
<data name="Validator_InstanceMustMatchValidationContextInstance" xml:space="preserve">
<value>The instance provided must match the ObjectInstance on the ValidationContext supplied.</value>
</data>
<data name="Validator_Property_Value_Wrong_Type" xml:space="preserve">
<value>The value for property '{0}' must be of type '{1}'.</value>
</data>
</root>
</root>

View File

@@ -1,17 +1,17 @@
<?xml version="1.0" encoding="utf-8"?>
<?xml version="1.0" encoding="utf-8"?>
<Project ToolsVersion="14.0" DefaultTargets="Build" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
<Import Project="$([MSBuild]::GetDirectoryNameOfFileAbove($(MSBuildThisFileDirectory), dir.props))\dir.props" />
<PropertyGroup>
<ProjectGuid>{4266D58F-EB60-46C2-BA81-3ABDE759A7D5}</ProjectGuid>
<RootNamespace>System.ComponentModel.Annotations</RootNamespace>
<AssemblyName>System.ComponentModel.Annotations</AssemblyName>
<IsPartialFacadeAssembly Condition="'$(TargetGroup)'=='net463'">true</IsPartialFacadeAssembly>
<IsPartialFacadeAssembly Condition="'$(TargetGroup)'=='netfx'">true</IsPartialFacadeAssembly>
</PropertyGroup>
<!-- Default configurations to help VS understand the options -->
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='net463-Windows_NT-Debug|AnyCPU'" />
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='net463-Windows_NT-Release|AnyCPU'" />
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='netstandard-Debug|AnyCPU'" />
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='netstandard-Release|AnyCPU'" />
<PropertyGroup Condition="'$(Configuration)|$(Platform)' == 'netfx-Debug|AnyCPU'" />
<PropertyGroup Condition="'$(Configuration)|$(Platform)' == 'netfx-Release|AnyCPU'" />
<PropertyGroup Condition="'$(Configuration)|$(Platform)' == 'netstandard-Debug|AnyCPU'" />
<PropertyGroup Condition="'$(Configuration)|$(Platform)' == 'netstandard-Release|AnyCPU'" />
<ItemGroup Condition="'$(TargetGroup)'=='netstandard'">
<Compile Include="System\ComponentModel\DataAnnotations\AssociationAttribute.cs" />
<Compile Include="System\ComponentModel\DataAnnotations\CompareAttribute.cs" />
@@ -60,9 +60,9 @@
<Link>Common\System\NotImplemented.cs</Link>
</Compile>
</ItemGroup>
<ItemGroup Condition="'$(TargetGroup)'=='net463'">
<TargetingPackReference Include="mscorlib" />
<TargetingPackReference Include="System.ComponentModel.DataAnnotations" />
<ItemGroup Condition="'$(TargetGroup)'=='netfx'">
<Reference Include="mscorlib" />
<Reference Include="System.ComponentModel.DataAnnotations" />
</ItemGroup>
<Import Project="$([MSBuild]::GetDirectoryNameOfFileAbove($(MSBuildThisFileDirectory), dir.targets))\dir.targets" />
</Project>
</Project>

View File

@@ -233,7 +233,7 @@ namespace System.ComponentModel.DataAnnotations
return SR.CustomValidationAttribute_ValidatorType_Required;
}
if (!_validatorType.GetTypeInfo().IsVisible)
if (!_validatorType.IsVisible)
{
return string.Format(CultureInfo.CurrentCulture,
SR.CustomValidationAttribute_Type_Must_Be_Public, _validatorType.Name);
@@ -327,8 +327,8 @@ namespace System.ComponentModel.DataAnnotations
// Null is permitted for reference types or for Nullable<>'s only
if (value == null)
{
if (expectedValueType.GetTypeInfo().IsValueType
&& (!expectedValueType.GetTypeInfo().IsGenericType
if (expectedValueType.IsValueType
&& (!expectedValueType.IsGenericType
|| expectedValueType.GetGenericTypeDefinition() != typeof(Nullable<>)))
{
return false;
@@ -338,7 +338,7 @@ namespace System.ComponentModel.DataAnnotations
}
// If the type is already legally assignable, we're good
if (expectedValueType.GetTypeInfo().IsAssignableFrom(value.GetType().GetTypeInfo()))
if (expectedValueType.IsInstanceOfType(value))
{
convertedValue = value;
return true;

View File

@@ -28,7 +28,7 @@ namespace System.ComponentModel.DataAnnotations
{
throw new InvalidOperationException(SR.EnumDataTypeAttribute_TypeCannotBeNull);
}
if (!EnumType.GetTypeInfo().IsEnum)
if (!EnumType.IsEnum)
{
throw new InvalidOperationException(string.Format(CultureInfo.CurrentCulture,
SR.EnumDataTypeAttribute_TypeNeedsToBeAnEnum, EnumType.FullName));
@@ -45,13 +45,13 @@ namespace System.ComponentModel.DataAnnotations
}
Type valueType = value.GetType();
if (valueType.GetTypeInfo().IsEnum && EnumType != valueType)
if (valueType.IsEnum && EnumType != valueType)
{
// don't match a different enum that might map to the same underlying integer
return false;
}
if (!valueType.GetTypeInfo().IsValueType && valueType != typeof(string))
if (!valueType.IsValueType && valueType != typeof(string))
{
// non-value types cannot be converted
return false;
@@ -68,7 +68,7 @@ namespace System.ComponentModel.DataAnnotations
}
object convertedValue;
if (valueType.GetTypeInfo().IsEnum)
if (valueType.IsEnum)
{
Debug.Assert(valueType == value.GetType(), "The valueType should equal the Type of the value");
convertedValue = value;
@@ -109,7 +109,7 @@ namespace System.ComponentModel.DataAnnotations
private static bool IsEnumTypeInFlagsMode(Type enumType)
{
return enumType.GetTypeInfo().GetCustomAttributes(typeof(FlagsAttribute), false).Any();
return enumType.GetCustomAttributes(typeof(FlagsAttribute), false).Any();
}

View File

@@ -130,7 +130,7 @@ namespace System.ComponentModel.DataAnnotations
var badlyConfigured = false;
// Make sure we found the property and it's the correct type, and that the type itself is public
if (!_resourceType.GetTypeInfo().IsVisible || property == null ||
if (!_resourceType.IsVisible || property == null ||
property.PropertyType != typeof(string))
{
badlyConfigured = true;

View File

@@ -187,7 +187,7 @@ namespace System.ComponentModel.DataAnnotations
SR.RangeAttribute_Must_Set_Operand_Type);
}
Type comparableType = typeof(IComparable);
if (!comparableType.GetTypeInfo().IsAssignableFrom(type.GetTypeInfo()))
if (!comparableType.IsAssignableFrom(type))
{
throw new InvalidOperationException(
string.Format(

View File

@@ -124,7 +124,7 @@ namespace System.ComponentModel.DataAnnotations
if (!_typeStoreItems.TryGetValue(type, out item))
{
// use CustomAttributeExtensions.GetCustomAttributes() to get inherited attributes as well as direct ones
var attributes = CustomAttributeExtensions.GetCustomAttributes(type.GetTypeInfo(), true);
var attributes = CustomAttributeExtensions.GetCustomAttributes(type, true);
item = new TypeStoreItem(type, attributes);
_typeStoreItems[type] = item;
}

View File

@@ -384,13 +384,13 @@ namespace System.ComponentModel.DataAnnotations
if (value == null)
{
// Null can be assigned only to reference types or Nullable or Nullable<>
return !destinationType.GetTypeInfo().IsValueType ||
(destinationType.GetTypeInfo().IsGenericType &&
return !destinationType.IsValueType ||
(destinationType.IsGenericType &&
destinationType.GetGenericTypeDefinition() == typeof(Nullable<>));
}
// Not null -- be sure it can be cast to the right type
return destinationType.GetTypeInfo().IsAssignableFrom(value.GetType().GetTypeInfo());
return destinationType.IsInstanceOfType(value);
}
/// <summary>

View File

@@ -1,17 +0,0 @@
<?xml version="1.0" encoding="utf-8"?>
<Project ToolsVersion="14.0" DefaultTargets="Build" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
<Import Project="$([MSBuild]::GetDirectoryNameOfFileAbove($(MSBuildThisFileDirectory), dir.props))\dir.props" />
<ItemGroup>
<Project Include="System.ComponentModel.Annotations.Tests.csproj" />
<Project Include="System.ComponentModel.Annotations.Tests.csproj">
<OSGroup>Windows_NT</OSGroup>
<TestTFMs>net463</TestTFMs>
</Project>
<Project Include="System.ComponentModel.Annotations.Tests.csproj">
<TargetGroup>netstandard1.4</TargetGroup>
<OSGroup>Windows_NT</OSGroup>
<TestTFMs>netcore50;net461</TestTFMs>
</Project>
</ItemGroup>
<Import Project="$([MSBuild]::GetDirectoryNameOfFileAbove($(MSBuildThisFileDirectory), dir.traversal.targets))\dir.traversal.targets" />
</Project>