C#.NET - What's "typeof"

jdana
jdana used Ask the Experts™
on
The following auto-code appears in AirplaneForm.designer.cs.  The code was generated when I dragged and dropped my Airplane entity (with EntityObject base class) onto a form.  What's up with the "typeof" method?
typeof.png
Comment
Watch Question

Do more with

Expert Office
EXPERT OFFICE® is a registered trademark of EXPERTS EXCHANGE®
Commented:
It returns the system type of the provided object (i.e. Airplane).

I'm not sure what else you needed to know.

Here's an MSDN link to explain a bit more...
http://msdn.microsoft.com/en-us/library/58918ffs(v=vs.71).aspx

hth

- Anthony
Mohamed AbowardaSenior Software Engineer
Commented:
Basically, typeof() is used to get the type of the variable.

The following example store information about the type of "integer" in the variable 'type':
System.Type type = typeof(int);

Open in new window

Author

Commented:
Medo3337, Thanks for the little code snippet.  Perfect explanation.

Do more with

Expert Office
Submit tech questions to Ask the Experts™ at any time to receive solutions, advice, and new ideas from leading industry professionals.

Start 7-Day Free Trial