Commit [c23b2198a450] (originating from pull request ["added displaynameattribute support"]) added support for [DisplayNameAttribute] in LoadFromCollection<T> in [ExcelRangeBase.cs].
While this could be useful, DisplayNameAttribute does not support localization of the display name as it must be a compile time constant.
[DisplayAttribute] on the other hand does allow localization through [DisplayAttribute.ResourceType], using this attribute instead of DisplayNameAttribute would provide a greater flexibility.
I can provide a pull request with the fix if you like.
[c23b2198a450]: https://epplus.codeplex.com/SourceControl/changeset/c23b2198a450
["added displaynameattribute support"]: https://epplus.codeplex.com/SourceControl/network/forks/anthonyjshaw/DisplayAttributeHeaderSupport/contribution/6413
[DisplayNameAttribute]: http://msdn.microsoft.com/en-gb/library/system.componentmodel.displaynameattribute.aspx
[ExcelRangeBase.cs]: https://epplus.codeplex.com/SourceControl/latest#EPPlus/ExcelRangeBase.cs
[DisplayAttribute]: http://msdn.microsoft.com/en-gb/library/system.componentmodel.dataannotations.displayattribute.aspx
[DisplayAttribute.ResourceType]: http://msdn.microsoft.com/en-gb/library/system.componentmodel.dataannotations.displayattribute.resourcetype.aspx
Comments: Upon creating the fork for the fix I noticed [DisplayAttribute] is available from .NET Framework 4 onward and EPPlus is targeting .NET Framework 3.5 Client Profile. Given that re-targeting EPPlus to the .NET Framework 4 is not a viable solution, do you think there is a workaround to the localization issue? [DisplayAttribute]: http://msdn.microsoft.com/en-gb/library/system.componentmodel.dataannotations.displayattribute.aspx
While this could be useful, DisplayNameAttribute does not support localization of the display name as it must be a compile time constant.
[DisplayAttribute] on the other hand does allow localization through [DisplayAttribute.ResourceType], using this attribute instead of DisplayNameAttribute would provide a greater flexibility.
I can provide a pull request with the fix if you like.
[c23b2198a450]: https://epplus.codeplex.com/SourceControl/changeset/c23b2198a450
["added displaynameattribute support"]: https://epplus.codeplex.com/SourceControl/network/forks/anthonyjshaw/DisplayAttributeHeaderSupport/contribution/6413
[DisplayNameAttribute]: http://msdn.microsoft.com/en-gb/library/system.componentmodel.displaynameattribute.aspx
[ExcelRangeBase.cs]: https://epplus.codeplex.com/SourceControl/latest#EPPlus/ExcelRangeBase.cs
[DisplayAttribute]: http://msdn.microsoft.com/en-gb/library/system.componentmodel.dataannotations.displayattribute.aspx
[DisplayAttribute.ResourceType]: http://msdn.microsoft.com/en-gb/library/system.componentmodel.dataannotations.displayattribute.resourcetype.aspx
Comments: Upon creating the fork for the fix I noticed [DisplayAttribute] is available from .NET Framework 4 onward and EPPlus is targeting .NET Framework 3.5 Client Profile. Given that re-targeting EPPlus to the .NET Framework 4 is not a viable solution, do you think there is a workaround to the localization issue? [DisplayAttribute]: http://msdn.microsoft.com/en-gb/library/system.componentmodel.dataannotations.displayattribute.aspx