MediaPropertySet.Clear | clear method

Applies to Windows and Windows Phone

Removes all items from the property set.

Syntax


mediaPropertySet.clear();

Parameters

This method has no parameters.

Examples

The following example gets an instance of the MediaPropertySet class from the AudioEncodingProperties class and then removes all items from the property set. The example also shows how to use the other methods in the MediaPropertySet class.



function getPropertySet() { 
    var encodingProperties = new Windows.Media.MediaProperties.AudioEncodingProperties();
    var props = encodingProperties.properties;
    // Remove all items from the property set.
    props.clear();
    // Get an iterator for this property set. 
    var itertator = props.first();
    // Get the immutable view of the property set.
    var view = props.getView();   
    // Determine if the set has an item with the specified key.   
    if (props.hasKey(key)) {
        // Use the item.
    }
    // Add an item with the specified key and value to the property set.    
    if (props.insert(key, value)) {
        // Value was replaced.
    }
    else {
        // New key and value.
    }
    // Get the value for the specified key.
    var value = props.lookup(key);
    // Remove the item with the specified key from the property set.
    props.remove(key);
    // Get the number of items in the property set.
    var number = props.size;
}


Requirements

Minimum supported client

Windows 8

Minimum supported server

Windows Server 2012

Minimum supported phone

Windows Phone 8.1 [Windows Phone Silverlight 8.1 and Windows Runtime apps]

Namespace

Windows.Media.MediaProperties
Windows::Media::MediaProperties [C++]

Metadata

Windows.winmd

See also

MediaPropertySet

 

 

Show:
© 2014 Microsoft