IRepositoryItem::Delete

See Also

This method deletes a Repository item.

HRESULT Delete( void );

Return Value

S_OK

The method completed successfully.

Error

Values

This method failed to complete successfully.

Remarks

If the item to be deleted is a Repository object version, this method fails unless the object version satisfies the basic requirements for object-version deletion. Furthermore, if the object version is checked out to any workspace, the Delete method fails unless you invoke it from within the context of that workspace. If object version satisfies both of these restrictions, the Repository deletes it and any of its relationships — including any delete-propagating origin relationships. For each of these relationships, the Repository considers performing one or more propagated deletions. (See Propagation after removing an origin relationship.)

If the item to be deleted is an origin versioned relationship, this method fails unless the source object version is changeable. If the source object version is changeable, the Repository deletes the entire relationship (rather than merely removing one item from the relationship's TargetVersions collection). In other words, after this method finishes, no version of the destination object remains related to the origin object version. Then, if the relationship is a delete-propagating relationship, the Repository considers performing one or more propagated deletions. (See Propagation after removing an origin relationship.)

If the item to be deleted is a destination versioned relationship, the Repository performs object-version Resolution to yield a single origin object version from the relationship's TargetVersions collection. If that origin object version is unchangeable, this method fails. If that origin object version is changeable, the Repository removes it from the relationship's TargetVersions collection. Then, if the relationship is a delete-propagating relationship, the Repository considers performing one or more propagated deletions. (See Propagation after removing a delete-propagating destination relationship.)