ISelectionSet
IFeatureClass
public ISelectionSet Select (
IQueryFilter QueryFilter,
esriSelectionType selType,
esriSelectionOption selOption,
IWorkspace selectionContainer
);
但是我却到现在也没搞明白得到了ISelectionSet以后干什么。
ISelectionSet
public ISelectionSet Select (
IQueryFilter QueryFilter,
esriSelectionType selType,
esriSelectionOption selOption,
IWorkspace selectionContainer
); 返回原来选择元素的一个子集
IMap
public void SelectFeature (
ILayer Layer,
IFeature Feature
);
Adds the feature to the feature layer's selection set. For example, the Editor's 'Create New Feature' task uses this method to select the new feature it has just created. This method also calls IActiveViewEvents::SelectionChanged to notify all listeners of the event.
IFeatureCursor
IFeatureLayer和IFeatureClass都具有 ISelectionSet也有
public IFeatureCursor Search (
IQueryFilter filter,
bool Recycling
);
IFeatureCursor的方法和属性有
DeleteFeature . Fields FindField Flush . InsertFeature NextFeature UpdateFeature
ISelection
IMap public ISelection FeatureSelection {get; set;}
ArcMap has two different selections, a feature selection and an element selection. Two different objects represent these selections and both implement the ISelection interface. The feature selection object additionally implements IEnumFeature and the element selection object IEnumElement. The ISelection interface is used for clipboard type operations and the IEnum interfaces are used to loop through the items in the collection.
When you ask for the FeatureSelection from IMap you are returned an ISelection but you can perform a query interface for IEnumFeature and usually do so. However, if you get the selection via IActiveView::Selection, the selection can either be an element selection or a feature selection depending on which one is currently active - only one of the selections can be active at a time. Use FeatureSelection to ensure a reference to the correct selection.
IFeatureSelection
IFeatureSelection is a very useful interface to manage or perform selection on a layer or to modify the way the selection is displayed.
IFeatureSelection.SelectFeatures
public void SelectFeatures (
IQueryFilter Filter,
esriSelectionResultEnum Method,
bool justOne
);
The following methods and properties are useful to manage the selection:
The CombinationMethod property is not used.
SelectionSet returns a SelectionSet corresponding to the current selection on the layer.
Clear will clear an existing selection.
Add adds one single feature to the selection.
SelectFeatures will perform a selection based on a query filter. If nothing is used as a query filter all the features will be selected. You can also specify a combination method. The justOne parameter tells the search to stop once it has found one feature.
Call SelectionChanged after modifying SelectionSet to fire update events on the layer.
The following methods and properties are useful to modify the way the selection is displayed:
SelectionSymbol will return or set the symbol used to display selected features on the layer.
SetSelectionSymbol is a boolean used to indicate if the SelectionSymbol is used or not to draw the selection. For feature layers, this is similar to using the "Show selected features...with this symbol" option in the layer properties.
SelectionColor is equivalent to using the "Show selected features...with this color" option in the layer properties.
If BufferDistance is set to a value greater than 0, a buffer will be drawn around the selected features. This is similar to using the Buffer Selection tool that can be added to the map with the Customize command found in the Tools menu.