1+ /*************************************************************************************************
2+ Required Notice: Copyright (C) EPPlus Software AB.
3+ This software is licensed under PolyForm Noncommercial License 1.0.0
4+ and may only be used for noncommercial purposes
5+ https://polyformproject.org/licenses/noncommercial/1.0.0/
6+
7+ A commercial license to use this software can be purchased at https://epplussoftware.com
8+ *************************************************************************************************/
9+ using OfficeOpenXml . Attributes ;
10+ #if ! NET35
11+ using System . ComponentModel . DataAnnotations ;
12+
13+ namespace EPPlusTest . LoadFunctions . AttributesTestClasses
14+ {
15+ /// <summary>
16+ /// Test class using DisplayAttribute with ResourceType.
17+ /// When ResourceType is set, GetName() should be used instead of Name
18+ /// to get the localized value from the resource class.
19+ /// </summary>
20+ public class ClassWithDisplayResourceType
21+ {
22+ [ EpplusTableColumn ( Order = 1 ) ]
23+ [ Display ( Name = "IdHeader" , ResourceType = typeof ( LoadFromCollResources ) ) ]
24+ public int Id { get ; set ; }
25+
26+ [ EpplusTableColumn ( Order = 2 ) ]
27+ [ Display ( Name = "NameHeader" , ResourceType = typeof ( LoadFromCollResources ) ) ]
28+ public string Name { get ; set ; }
29+
30+ [ EpplusTableColumn ( Order = 3 ) ]
31+ [ Display ( Name = "DescriptionHeader" , ResourceType = typeof ( LoadFromCollResources ) ) ]
32+ public string Description { get ; set ; }
33+ }
34+ }
35+ #endif
0 commit comments