I have a method that has 3 overrides, but calling the method outside of a "parent" override (one that accepts no parameters) is useless. Other than a xml comment indicating this, is there an attribute that I can use to mark the method as such?

Some additional information if needed:

The "parent" method accepts no parameters, and just loops through controls on a form to mark them read-only or editable. When that method runs into a panel, or into a groupbox, it calls the appropriate method that begins a new loop through the contents of THAT groupbox or panel using an override method, and if it runs into a panel or groupbox it starts yet another loop until all controls possible are changed...but calling the override methods that accept a groupbox or panel as a parameter would be useless to call if called separately from the "parent" method.

I hope that makes sense...unless someone has a better idea for the concept in general, I'm just looking for a way to prevent myself (or anyone else) from using the overrides, it's already marked private, but other than xml comments, I don't know of a way to make it stand out as a "hey dummy! don't use me out of context!"

Recommended Answers

All 2 Replies

Mark them private. Only the object will be able to access them then. Other than that, there isn't anything you can do.

I do wonder why you are so concerned that someone will call them.

I'm not sure why, I'm just a nervous person I guess. Just thought there might be an attribute I could use that would remind myself and others. I'll just make a note in the xml documentation :)

Be a part of the DaniWeb community

We're a friendly, industry-focused community of developers, IT pros, digital marketers, and technology enthusiasts meeting, networking, learning, and sharing knowledge.