Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
Validating on Overridable method
Message
From
05/09/2011 15:17:07
 
 
To
05/09/2011 14:53:41
General information
Forum:
ASP.NET
Category:
Coding, syntax and commands
Environment versions
Environment:
VB 9.0
OS:
Windows 7
Network:
Windows 2003 Server
Database:
MS SQL Server
Application:
Web
Miscellaneous
Thread ID:
01522449
Message ID:
01522755
Views:
19
>>As long as you are sure it's safe.
>>If someone can sub-class your base class there's nothing to stop them deriving from the derived class - in which case your code would break. If your class is directly derived from Object then you could identify it like this:
Dim parent As Type = t ' where t is type of actual class
>>While True
>>	If parent.BaseType = GetType([Object]) Then
>>		Exit While
>>	Else
>>		parent = parent.BaseType
>>	End If
>>End While
>>
>>'Parent is now your base class
>>
>>
>>But at that point it probably makes as much sense to pass in the name of the class anyway....
>
>As this is at the framework level, I would like to make it more bullet proof. Also, the framework as some sub classes of the DataEntry class itself. So, I need to fine tune here. Could you elaborate more on the If condition in here which will exit the While? I understand it is a comparism to know if we have reached the top level. So, for as long as the While goes, we climb the chain. But, what does Object represent in that line?

The class from which all other .NET reference types are derived. If you simply declare a class without specifying a base class then it derives from System.Object.
Previous
Next
Reply
Map
View

Click here to load this message in the networking platform