public enum SelectionType : System.Enum, System.IComparable, System.IConvertible, System.IFormattable
Public Enum SelectionType Inherits System.Enum Implements System.IComparable, System.IConvertible, System.IFormattable
public enum SelectionType : System.Enum, System.IComparable, System.IConvertible, System.IFormattable
Public Enum SelectionType Inherits System.Enum Implements System.IComparable, System.IConvertible, System.IFormattable
Member | Description |
---|---|
GlobalID | A selection based on global ID. |
ObjectID | A selection based on object ID. |
public async Task SelectingRowsFromATable() { await ArcGIS.Desktop.Framework.Threading.Tasks.QueuedTask.Run(() => { using (Geodatabase geodatabase = new Geodatabase(new DatabaseConnectionFile(new Uri("path\\to\\sde\\file\\sdefile.sde")))) using (Table enterpriseTable = geodatabase.OpenDataset<Table>("LocalGovernment.GDB.piCIPCost")) { QueryFilter anotherQueryFilter = new QueryFilter { WhereClause = "FLOOR = 1 AND WING = 'E'" }; // For Selecting all matching entries. using (Selection anotherSelection = enterpriseTable.Select(anotherQueryFilter, SelectionType.ObjectID, SelectionOption.Normal)) { } // This can be used to get one record which matches the criteria. No assumptions can be made about which record satisfying the criteria is selected. using (Selection onlyOneSelection = enterpriseTable.Select(anotherQueryFilter, SelectionType.ObjectID, SelectionOption.OnlyOne)) { } // This can be used to obtain a empty selction which can be used as a container to combine results from different selections. using (Selection emptySelection = enterpriseTable.Select(anotherQueryFilter, SelectionType.ObjectID, SelectionOption.Empty)) { } // If you want to select all the records in a table. using (Selection allRecordSelection = enterpriseTable.Select(null, SelectionType.ObjectID, SelectionOption.Normal)) { } } }); }
public async Task SelectingFeaturesFromAFeatureClass() { await ArcGIS.Desktop.Framework.Threading.Tasks.QueuedTask.Run(() => { using (Geodatabase geodatabase = new Geodatabase(new DatabaseConnectionFile(new Uri("path\\to\\sde\\file\\sdefile.sde")))) using (FeatureClass enterpriseFeatureClass = geodatabase.OpenDataset<FeatureClass>("LocalGovernment.GDB.FacilitySite")) { List<Coordinate2D> newCoordinates = new List<Coordinate2D> { new Coordinate2D(1021570, 1880583), new Coordinate2D(1028730, 1880994), new Coordinate2D(1029718, 1875644), new Coordinate2D(1021405, 1875397) }; SpatialQueryFilter spatialFilter = new SpatialQueryFilter { WhereClause = "FCODE = 'Park'", FilterGeometry = new PolygonBuilderEx(newCoordinates).ToGeometry(), SpatialRelationship = SpatialRelationship.Crosses }; // For Selecting all matching entries. using (Selection anotherSelection = enterpriseFeatureClass.Select(spatialFilter, SelectionType.ObjectID, SelectionOption.Normal)) { } // This can be used to get one record which matches the criteria. No assumptions can be made about which record satisfying the // criteria is selected. using (Selection onlyOneSelection = enterpriseFeatureClass.Select(spatialFilter, SelectionType.ObjectID, SelectionOption.OnlyOne)) { } // This can be used to obtain a empty selction which can be used as a container to combine results from different selections. using (Selection emptySelection = enterpriseFeatureClass.Select(spatialFilter, SelectionType.ObjectID, SelectionOption.Empty)) { } // If you want to select all the records in a table. using (Selection allRecordSelection = enterpriseFeatureClass.Select(null, SelectionType.ObjectID, SelectionOption.Normal)) { } } }); }
System.Object
System.ValueType
System.Enum
ArcGIS.Core.Data.SelectionType
Target Platforms: Windows 11, Windows 10