Export (0) Print
Expand All

IWMPMediaCollection::setDeleted method

The setDeleted method moves the specified media item to the deleted items folder.

Syntax



public void setDeleted(
  IWMPMedia pItem,
  System.Boolean varfIsDeleted
);


Parameters

pItem [in]

A WMPLib.IWMPMedia interface for the item to be moved.

varfIsDeleted [in]

A System.Boolean value that specifies whether the item should be moved to the deleted items folder. This value must always be true.

Return value

This method does not return a value.

Remarks

This method does not remove files from the user's computer, it just moves them to the deleted items folder.

Before calling this method, you must have read access to the library. For more information, see Library Access.

Examples

The following example uses setDeleted to move a particular media item to the deleted items folder. The isDeleted method first tests whether the item has already been deleted. The AxWMPLib.AxWindowsMediaPlayer object is represented by the variable named player.



// Test whether the media item has already been deleted.
if (!player.mediaCollection.isDeleted(media))
{
    // The item is available to be deleted; move it to the deleted items folder.
    player.mediaCollection.setDeleted(media, true);

    // Inform the user that the operation succeeded.
    System.Windows.Forms.MessageBox.Show("Item moved to deleted items folder.");
}
else
{
    // Tell the user the operation is unnecessary.
    System.Windows.Forms.MessageBox.Show("Item is already deleted!");
}


Requirements

Version

Windows Media Player 9 Series or later

Namespace

WMPLib

Assembly

Interop.WMPLib.dll (Interop.WMPLib.dll.dll)

See also

IWMPMedia Interface (VB and C#)
IWMPMediaCollection Interface (VB and C#)

 

 

Community Additions

ADD
Show:
© 2015 Microsoft