Persistate API documentation
Remove Method (obj)
NamespacesPersistateIndexedList<(Of <(<'T>)>)>Remove(T)

[This is preliminary documentation and is subject to change.]

Removes a T object from the collection.
Declaration Syntax
C#
public bool Remove(
	T obj
)
Parameters
obj (T)
The object to remove from the list.
Return Value
True if the object was in the (non-ordered) list and was removed, otherwise false.
Remarks

This works slightly differently, depending on whether or not the collection is ordered. In ordered collections, objects in the list are always found at the position specified by their Order property. For ordered lists, a check is made that the supplied object is in fact in the list at the position given by its order field. If it is, then the Order property in all subsequent objects in the collection is decremented by 1.

For non-ordered lists, no check is made that the object is or is not in the list. If it is, it is removed. If it is not, no exception is thrown.

NB: There is a special case for many type collections. Even though the object is not currently in this list in memory, so long as the parent and class of the object are the same as this collection, it is still removed from the persistent tree. In this case, false is returned.

If the object to remove is a Choice object and this is a contained Choice collection created in generated code, then the Target of the Choice is the object which is deleted from persistent storage. This is what allows you to delete objects from the grid in lookup forms.

Exceptions
ExceptionCondition
ArgumentNullExceptionSupplied object is null.
ArgumentExceptionSupplied object was not in an ordered list at the position given by its Order property.

Assembly: Persistate (Module: Persistate) Version: 0.6.1.20 (0.6.1.20)