Description

Removes an image from the collection.

Return Type

None  

Syntax

object.Remove Index

The Remove Method syntax has these parts:

PartDescription
objectAn expression evaluating to an object of type McImages.
IndexRequired. A Variant value.

Remarks

McObject notify clients have an opportunity to prevent the removal of any image from the collection (see Notes). Furthermore, the image will actually be destroyed only when all references to its McImage instance have been fully released. However, once an McImage is removed from the Images collection an Item lookup on it will fail, even if it still exists.

Removing an image from the collection changes the collection index associated with all images added after the removed image.

A SNC_NOTIFY_IMS_IMAGE_TOBE_REMOVED SpecialNotify is sent to standard notify clients of the McObject(Images) before an image is removed from the collection (the SpecialNotify VARIANT argument will hold the instance of the McImage about to be removed). If any of the notify clients return S_FALSE from the SpecialNotify call, then no further clients are notified, and the removal is aborted.

An SNC_NOTIFY_IMS_IMAGE_WAS_REMOVED is sent to notify clients after the image is removed from the collection (the SpecialNotify VARIANT argument will hold the instance of the McImage that was removed).

The McImage.Collection property will be NULL after an image has been removed from the collection, and the image will be destroyed when all references held on it are released. Notify sinks of the McImage being removed are sent an OnPropertyChanged(ID_IMcImage_Collection) event after the McImage was removed from the collection, but before it is given its Release.

When the image is fully released, standard notify clients of the McObject(McImage) will receive an AboutToBeDeleted standard notify just as the image is destroyed (this process cannot be aborted by a notify client). Clients should not try to make use of the McImage during this notification.

When an image is removed from the collection, its UndoStack is flushed.

Exceptions

The argument must resolve to an McImage instance.