You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
I've found that to have Category and DisplayName attributes to show up in a PropertyGrid) when using iconfig you have to do the below (or add a viewmodel to wrap the config).
[AttributeUsage(AttributeTargets.All, Inherited = false)]
public class NonInheritedDescriptionAttribute : DescriptionAttribute
{
public NonInheritedDescriptionAttribute(string description) : base(description) { }
}
This works great, but the PasswordPropertyTextAttribute is a sealed class and so can not be inherited.
I saw that in a future version of castle there will be AttributesToAlwaysReplicatecastleproject/Core#633
I tested this and it works well here, I think it could be a good feature. Maybe using reflection all properties could be added to replicate as well. I just added the ones I needed.
I've found that to have Category and DisplayName attributes to show up in a PropertyGrid) when using iconfig you have to do the below (or add a viewmodel to wrap the config).
castleproject/Core#593 (comment)
[AttributeUsage(AttributeTargets.All, Inherited = false)]
public class NonInheritedDescriptionAttribute : DescriptionAttribute
{
public NonInheritedDescriptionAttribute(string description) : base(description) { }
}
This works great, but the PasswordPropertyTextAttribute is a sealed class and so can not be inherited.
I saw that in a future version of castle there will be AttributesToAlwaysReplicate castleproject/Core#633
I tested this and it works well here, I think it could be a good feature. Maybe using reflection all properties could be added to replicate as well. I just added the ones I needed.
Here is the commit where I tested it.
ykarpeev@0a2aa04
The text was updated successfully, but these errors were encountered: