Matthew,
I assume you are asking about feature classes inside a file geodatabase (a feature layer is a map layer that obtains its data from a feature class). The best way to check for feature class existence is the following:
public bool FeatureClassExists(Geodatabase geodatabase, string featureClassName)
{
try
{
FeatureClassDefinition featureClassDefinition = geodatabase.GetDefinition<FeatureClassDefinition(featureClassName);
featureClassDefinition.Dispose();
return true;
}
catch
{
return false;
}
}
To get a list of all of the feature classes in a geodatabase, use Geodatabase.GetDefinitions<FeatureClass>() and iterate through the returned list.
I hope this helps,
--Rich