Skip to content
This repository has been archived by the owner on Jan 23, 2023. It is now read-only.
/ corefx Public archive

Add CoreLib helper used by DefaultValueAttribute constructor #31739

Merged
merged 1 commit into from
Aug 13, 2018
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
8 changes: 8 additions & 0 deletions src/System.ComponentModel.TypeConverter/src/ILLinkTrim.xml
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
<linker>
<assembly fullname="System.ComponentModel.TypeConverter">
<type fullname="System.ComponentModel.TypeDescriptor">
<!-- called through reflection by System.ComponentModel.DefaultValueAttribute -->
<method name="ConvertFromInvariantString" />
</type>
</assembly>
</linker>
Original file line number Diff line number Diff line change
Expand Up @@ -808,6 +808,12 @@ public static TypeConverter GetConverter(Type type)
return GetDescriptor(type, nameof(type)).GetConverter();
}

// This is called by System.ComponentModel.DefaultValueAttribute via reflection.
private static object ConvertFromInvariantString(Type type, string stringValue)
{
return GetConverter(type).ConvertFromInvariantString(stringValue);
}

/// <summary>
/// Gets the default event for the specified type of component.
/// </summary>
Expand Down