Export (0) Print
Expand All
This topic has not yet been rated - Rate this topic

Protected Members

Protected members on unsealed classes give developers a way to customize the behavior of a class. For example, methods that raise events are often defined as having protected visibility to allow derived classes to provide additional processing before or after the event is raised.

Important noteImportant

The term "protected" does not imply any security checking or caller validation. Protected members can be accessed simply by defining a derived class of the declaring type.

Consider using protected members for advanced customization. Protected members are a great way to provide advanced customization without complicating the public interface.

Do treat protected members on unsealed classes as public for the purposes of security, documentation, and compatibility analysis. Arbitrary code can access protected members through subclassing.

Portions Copyright 2005 Microsoft Corporation. All rights reserved.

Portions Copyright Addison-Wesley Corporation. All rights reserved.

For more information on design guidelines, see the "Framework Design Guidelines: Conventions, Idioms, and Patterns for Reusable .NET Libraries" book by Krzysztof Cwalina and Brad Abrams, published by Addison-Wesley, 2005.

Did you find this helpful?
(1500 characters remaining)
Thank you for your feedback

Community Additions

ADD
Show:
© 2014 Microsoft. All rights reserved.