Share via


IWMPSettings.isAvailable (VB e C#)

[La funzionalità associata a questa pagina, Lettore multimediale Windows SDK, è una funzionalità legacy. È stato sostituito da MediaPlayer. MediaPlayer è stato ottimizzato per Windows 10 e Windows 11. Microsoft consiglia vivamente che il nuovo codice usi MediaPlayer invece di Lettore multimediale Windows SDK, quando possibile. Microsoft suggerisce che il codice esistente che usa le API legacy venga riscritto per usare le nuove API, se possibile.

La proprietà isAvailable (il metodo get_isAvailable in C#) ottiene un valore che indica se è possibile eseguire un'azione specificata.

[Visual Basic]
ReadOnly Property isAvailable(
  bstrItem As System.String
) As System.Boolean
[C#]
System.Boolean get_isAvailable (
  System.String bstrItem
);

Parametri

bstrItem

Oggetto System.String che è uno dei valori seguenti.

Valore Descrizione
avvio automatico Determina se la proprietà autoStart può essere impostata per specificare che Lettore multimediale Windows avvia automaticamente la riproduzione.
Balance Individua se la proprietà di bilanciamento può essere utilizzata per impostare il bilanciamento stereo.
BaseURL Determina se la proprietà baseURL può essere impostata per specificare un URL di base.
DefaultFrame Determina se la proprietà defaultFrame può essere impostata per specificare il frame predefinito.
EnableErrorDialogs Determina se la proprietà enableErrorDialogs può essere impostata per abilitare o disabilitare la visualizzazione delle finestre di dialogo di errore.
GetMode Individua se il metodo getMode può essere utilizzato per recuperare il ciclo corrente o la modalità casuale.
InvokeURLs Determina se la proprietà invokeURLs può essere impostata per specificare se gli eventi URL devono avviare un Web browser.
Disattiva audio Determina se è possibile impostare la proprietà mute per specificare se l'output audio è attivato o disattivato.
PlayCount Determina se la proprietà playCount può essere impostata per specificare il numero di riproduzione di un elemento multimediale.
Tariffa Determina se la proprietà rate può essere impostata per controllare la frequenza di riproduzione.
SetMode Consente di determinare se il metodo setMode può essere utilizzato per specificare il ciclo corrente o la modalità casuale.
Volume Individua se la proprietà del volume può essere impostata per specificare il volume audio.

Valore della proprietà

Valore System.Boolean che indica se è possibile eseguire l'azione specificata.

Commenti

IWMPSettings.isIdentical è una proprietà di Visual Basic che accetta un parametro. In C# viene definito metodo IWMPSettings.get_isIdentical .

Esempio

Nell'esempio seguente viene verificata ogni proprietà IWMPSettings usando la proprietà isAvailable (il metodo get_isAvailable in C#). Il nome della proprietà e il risultato di ogni test vengono visualizzati in una casella di testo a più righe. L'oggetto AxWMPLib.AxWindowsMediaPlayer è rappresentato dalla variabile denominata player.

// Create a string array that contains a list of IWMPSettings properties.
string[] propertyList = new string[12]{
    "AutoStart", "Balance", "BaseURL", "DefaultFrame", "EnableErrorDialogs",
    "GetMode", "InvokeURLs", "Mute", "PlayCount", "Rate", "SetMode", "Volume"
};

// Create another string array of the same size to hold the result of each
// call to get_isAvailable.
string[] results = new string[12];

// Test each property using get_isAvailable and add the name of the property
// and the result of the test to the results array.
for (int i = 0; i < propertyList.Length; i++)
{
    bool isAvailable = player.settings.get_isAvailable(propertyList[i]);

    results[i] = (propertyList[i] + " = " + isAvailable.ToString());
}

// Display the results in a multi-line text box.
playerSettings.Lines = results;

'  Create a string array that contains a list of IWMPSettings properties.
Dim propertyList As String() = New String(11) { _
    &quot;AutoStart&quot;, &quot;Balance&quot;, &quot;BaseURL&quot;, &quot;DefaultFrame&quot;, &quot;EnableErrorDialogs&quot;, _
    &quot;GetMode&quot;, &quot;InvokeURLs&quot;, &quot;Mute&quot;, &quot;PlayCount&quot;, &quot;Rate&quot;, &quot;SetMode&quot;, &quot;Volume&quot; _
}

&#39;  Create another string array of the same size to hold the result of each
&#39;  call to get_isAvailable.
Dim results(12) As String

&#39;  Test each property using isAvailable and add the name of the property
&#39;  and the result of the test to the results array.
For i As Integer = 0 To (propertyList.Length - 1)

    Dim isAvailable As Boolean = player.settings.isAvailable(propertyList(i))
    results(i) = (propertyList(i) + &quot; = &quot; + isAvailable.ToString())

Next i

&#39;  Display the results in a multi-line text box.
playerSettings.Lines = results

Requisiti

Requisito Valore
Versione
Lettore multimediale Windows serie 9 o successive
Spazio dei nomi
WMPLib
Assembly
Interop.WMPLib.dll (Interop.WMPLib.dll.dll)

Vedi anche

Interfaccia IWMPSettings (VB e C#)

IWMPSettings.autoStart (VB e C#)

IWMPSettings.balance (VB e C#)

IWMPSettings.baseURL (VB e C#)

IWMPSettings.defaultFrame (VB e C#)

IWMPSettings.enableErrorDialogs (VB e C#)

IWMPSettings.getMode (VB e C#)

IWMPSettings.invokeURLs (VB e C#)

IWMPSettings.mute (VB e C#)

IWMPSettings.playCount (VB e C#)

IWMPSettings.rate (VB e C#)

IWMPSettings.setMode (VB e C#)

IWMPSettings.volume (VB e C#)