![](/img/trans.png)
[英]C# Attribute XmlIgnore and XamlWriter class - XmlIgnore not working
[英]In C# how can I check that XmlIgnore attribute is applied on a property or not?
我想检查propertyInfo以确定是否将XmlIgnore
属性应用于给定属性。 我怎样才能做到这一点?
bool b = type.GetProperty("MyProp")
.GetCustomAttributes(false)
.Any(a => a is XmlIgnoreAttribute);
typeof(string).GetProperty("Length").GetCustomAttributes(typeof(some attr))
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.