This document is archived and information here might be outdated. Recommended version. |
ArcObjects Help for .NET developers > ArcObjects namespaces > System > ESRI.ArcGIS.esriSystem > Interfaces > IS > ISet Interface > ISet.Add Method (ArcObjects .NET 10.5 SDK) |
Adds an object to the set.
[Visual Basic .NET] Public Sub Add ( _ ByVal unk As Object _ )
[C#] public void Add ( object unk );
[C++]
HRESULT Add(
LPUNKNOWN unk
);
[C++]
Parameters unk [in] unk is a parameter of type LPUNKNOWN
Adds the specified object to the Set. If you add the same object to a Set twice, no error occurs but the resulting Set has only one reference to the object.
The order in which objects are added to the Set using Add is not guaranteed to be the same order in which they are returned by the Next method.
When adding an object to a Set, you are merely adding a new reference to the object not copying it. The reference is released when the Set is destroyed or the object is removed. For example, if you add geodatabase features to a Set (or an Array) using a feature cursor, you must use a non-recycling cursor, otherwise the memory location of the previous feature is overwritten.