IWMPQuery :: beginNextGroup, méthode
La méthode beginNextGroup commence un nouveau groupe de conditions.
Syntaxe
public void beginNextGroup();
Public Sub beginNextGroup()
Implements IWMPQuery.beginNextGroup
Paramètres
Cette méthode n’a aucun paramètre.
Valeur retournée
Cette méthode ne retourne pas de valeur.
Remarques
Le démarrage d’un nouveau groupe de conditions implique que vous avez terminé le groupe de conditions actuel. Le nouveau groupe de conditions est toujours concaténé au groupe de conditions précédent à l’aide de ou logique.
Exemples
L’exemple suivant crée une requête complexe en peignant deux groupes qui contiennent chacun une condition. Les résultats de la requête sont extraits sous la forme d’une collection de chaînes et s’affichent dans une zone de liste. L’objet AxWMPLib. AxWindowsMediaPlayer est représenté par la variable Player.
// Get a new Query interface.
WMPLib.IWMPMediaCollection2 mc = (WMPLib.IWMPMediaCollection2)player.mediaCollection;
WMPLib.IWMPQuery q = mc.createQuery();
// Add a condition to the Query.
q.addCondition("WM/Composer", "Equals", "Antonio Vivaldi");
// Begin another Query group.
q.beginNextGroup();
// Add a condition to the new group understanding that it will be combined with the
// first group using OR logic.
q.addCondition("Title", "Contains", "Capriol");
// Query the media collection and get a string collection containing the result.
// In this case, the string collection will contain the titles of all audio items that
// match the query.
WMPLib.IWMPStringCollection2 result = (WMPLib.IWMPStringCollection2)mc.getStringCollectionByQuery("Title", q, "audio", "", false);
// Display the results by adding them to a list box.
for (int i = 0; i < result.count; i++)
{
complexQueryResults.Items.Add(result.Item(i));
}
' Get a new Query interface.
Dim mc As WMPLib.IWMPMediaCollection2 = player.mediaCollection
Dim q As WMPLib.IWMPQuery = mc.createQuery()
' Add a condition to the Query.
q.addCondition("WM/Composer", "Equals", "Antonio Vivaldi")
' Begin another Query group.
q.beginNextGroup()
' Add a condition to the new group understanding that it will be combined with the
' first group using OR logic.
q.addCondition("Title", "Contains", "Capriol")
' Query the media collection and get a string collection containing the result.
' In this case, the string collection will contain the titles of all audio items that
' match the query.
Dim result As WMPLib.IWMPStringCollection2 = mc.getStringCollectionByQuery("Title", q, "audio", "", False)
' Display the results by adding them to a list box.
For i As Integer = 0 To (result.count - 1)
complexQueryResults.Items.Add(result.Item(i))
Next i
Configuration requise
| Condition requise | Valeur |
|---|---|
| Version |
Lecteur Windows Media 11. |
| Espace de noms |
WMPLib |
| Assembly |
|