public enum DefinitionRelationshipType : System.Enum, System.IComparable, System.IConvertible, System.IFormattable
Public Enum DefinitionRelationshipType Inherits System.Enum Implements System.IComparable, System.IConvertible, System.IFormattable
public enum DefinitionRelationshipType : System.Enum, System.IComparable, System.IConvertible, System.IFormattable
Public Enum DefinitionRelationshipType Inherits System.Enum Implements System.IComparable, System.IConvertible, System.IFormattable
Member | Description |
---|---|
DatasetInFeatureDataset | The Dataset contained within an FeatureDataset. |
DatasetsRelatedThrough | The Dataset related through an RelationshipClass or AttributedRelationshipClass. |
FeatureClassInUtilityNetwork | The FeatureClass participating in an ArcGIS.Core.Data.UtilityNetwork.UtilityNetwork. |
TableInUtilityNetwork | The Table participating in an ArcGIS.Core.Data.UtilityNetwork.UtilityNetwork. |
public async Task ObtainingRelatedDefinitionsFromGeodatabase() { await ArcGIS.Desktop.Framework.Threading.Tasks.QueuedTask.Run(() => { using (Geodatabase geodatabase = new Geodatabase(new DatabaseConnectionFile(new Uri("path\\to\\sde\\file\\sdefile.sde")))) { // Remember the qualification of DatabaseName. for the RelationshipClass. RelationshipClassDefinition enterpriseDefinition = geodatabase.GetDefinition<RelationshipClassDefinition>("LocalGovernment.GDB.AddressPointHasSiteAddresses"); IReadOnlyList<Definition> enterpriseDefinitions = geodatabase.GetRelatedDefinitions(enterpriseDefinition, DefinitionRelationshipType.DatasetsRelatedThrough); FeatureClassDefinition enterpriseAddressPointDefinition = enterpriseDefinitions.First( defn => defn.GetName().Equals("LocalGovernment.GDB.AddressPoint")) as FeatureClassDefinition; FeatureDatasetDefinition featureDatasetDefinition = geodatabase.GetDefinition<FeatureDatasetDefinition>("LocalGovernment.GDB.Address"); IReadOnlyList<Definition> datasetsInAddressDataset = geodatabase.GetRelatedDefinitions(featureDatasetDefinition, DefinitionRelationshipType.DatasetInFeatureDataset); FeatureClassDefinition addressPointInAddressDataset = datasetsInAddressDataset.First( defn => defn.GetName().Equals("LocalGovernment.GDB.AddressPoint")) as FeatureClassDefinition; RelationshipClassDefinition addressPointHasSiteAddressInAddressDataset = datasetsInAddressDataset.First( defn => defn.GetName().Equals("LocalGovernment.GDB.AddressPointHasSiteAddresses")) as RelationshipClassDefinition; } }); }
public async Task GetFeatureClassesInRelationshipClassAsync() { await ArcGIS.Desktop.Framework.Threading.Tasks.QueuedTask.Run(() => { using (Geodatabase geodatabase = new Geodatabase(new FileGeodatabaseConnectionPath(new Uri(@"C:\Data\LocalGovernment.gdb")))) { IReadOnlyList<RelationshipClassDefinition> relationshipClassDefinitions = geodatabase.GetDefinitions<RelationshipClassDefinition>(); foreach (var relationshipClassDefinition in relationshipClassDefinitions) { IReadOnlyList<Definition> definitions = geodatabase.GetRelatedDefinitions(relationshipClassDefinition, DefinitionRelationshipType.DatasetsRelatedThrough); foreach (var definition in definitions) { System.Diagnostics.Debug.WriteLine( $"Feature class in the RelationshipClass is:{definition.GetName()}"); } } } }); }
System.Object
System.ValueType
System.Enum
ArcGIS.Core.Data.DefinitionRelationshipType
Target Platforms: Windows 11, Windows 10, Windows 8.1