TICS Coding Standard Viewer 
TIOBE Software Quality Framework
Print-friendly version
©TIOBE Software www.tiobe.com
 
C# Coding Standard
Search

Rule:  10@404

Synopsis:Only implement casts that operate on the complete object
Language:C#
Severity Level:2
Category:Data types


Description:

In other words, do not cast one type to another using a member of the source type. For example, a Button class has a string property Name. It is valid to cast the Button to the Control (since Button is a Control), but it is not valid to cast the Button to a string by returning the value of the Name property.