In help is written that IDataset::Subsets is not supported for Graph. 2) IGraph is implemented only from geometric Network class so Subsets will throw an exception only geometric Network.1) you can check if you have a gn in container (you can have only 1 gn in container) for know if you have a graph and so ...(see 2)I agree "...since using exceptions for normal flow of control is a horrible coding practice..."
if(!(dataset is IGraph )) // something with dataset.Subsets
"... IDataset::Subsets is not supported for Graph objects such as a Geometric Network. To return the feature classes contained in a Geometric Network, use the IFeatureClassContainer interface...."see Remarks http://help.arcgis.com/en/sdk/10.0/arcobjects_net/componenthelp/index.html#/Subsets_Property/00250000017z000000/
I think that NotImplementedException/NotSupportedException- not everything is available.For instance, you can have interfaces that support a pair "CanUseFind?" / "Find". If the "CanUseFind?" returns false, it is reasonable "Find" throw NotSupportedException.Here for particular data (Graph) is used IFeatureClassContainer. you catch this error for see if implemented this method.
// if not a container, check for subsets
if (_dataset.Type != esriDatasetType.esriDTContainer )
// if dataset doesn't implement IFeatureClassContainer, check for subsets
if (!(_dataset is IFeatureClassContainer))
Yes, it's method right.
Retrieving data ...