【发布时间】:2015-01-10 23:14:23
【问题描述】:
类似于Get properties in order of declaration using reflection 我想按声明的顺序获取属性。显然,我指的是属性将AllowMultiple 设置为true 的AttributeUsage。
我想知道MemberInfo.GetCustomAttributes 或Attribute.GetCustomAttributes 是否保证任何排序(我在MSDN 中没有找到任何东西)。
【问题讨论】:
-
我不确定任何地方都定义了这些的顺序;你可能还想看看GetCustomAttributesData,但这也不是明确的声明顺序
标签: c# reflection