Rajaat Posted May 17, 2004 Posted May 17, 2004 I want to apply an attribute to an inherited method and I'm wondering if there's a way to do that without needing to implement the method again in the derived class... Here's an example of how I need to do it: namespace X { public class Base { public void MethodA() { // implementation } } public class Derived : Base { [AttributeToApply] public new void MethodA() { base.MethodA(); } } } I would like to avoid providing a new implementation for MethodA() but somehow apply the attribute in the derived class.... I know if I apply the attribute in the base class then the derived class will inherit the attribute but I want to give the derived class the ability to decide who should get the attribute. Any ideas? Quote
*Experts* Nerseus Posted May 18, 2004 *Experts* Posted May 18, 2004 I don't think it's possible. -Nerseus Quote "I want to stand as close to the edge as I can without going over. Out on the edge you see all the kinds of things you can't see from the center." - Kurt Vonnegut
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.