This document is archived and information here might be outdated.  Recommended version.


Statements - Interrogate Object Snippet (ArcObjects .NET 10.4 SDK)
ArcObjects Library Reference

Statements - Interrogate Object Snippet

Generic template for determining what type of object you are working with.

[C#]
//<-- Snippet Start -->
// DESCRIPTION:
// Generic template for determining what type of object you are working with.

if (objectexpression is typename) 
{ 
}

//<-- Snippet End -->
[Visual Basic .NET]
'<-- Snippet Start -->
' DESCRIPTION:
' Generic template for determining what type of object you are working with.

If TypeOf objectexpression Is typename Then

End If

'<-- Snippet End -->

Additional Requirements
  • The code in this document requires the following References added to the Visual Studio project:
  • System