IFeatureSupport Interface
Definição
Importante
Algumas informações dizem respeito a um produto pré-lançado que pode ser substancialmente modificado antes de ser lançado. A Microsoft não faz garantias, de forma expressa ou implícita, em relação à informação aqui apresentada.
Especifica uma interface padrão para recuperar informação de funcionalidades do sistema atual.
public interface class IFeatureSupport
public interface IFeatureSupport
type IFeatureSupport = interface
Public Interface IFeatureSupport
- Derivado
Exemplos
O exemplo seguinte utiliza a OSFeature implementação de IFeatureSupport e consultas para a LayeredWindows funcionalidade. A versão é verificada para verificar se é null, para determinar se a funcionalidade está presente. O resultado é apresentado numa caixa de texto. Este código assume textBox1 que foi criado e colocado num formulário.
private:
void LayeredWindows()
{
// Gets the version of the layered windows feature.
Version^ myVersion = OSFeature::Feature->GetVersionPresent(
OSFeature::LayeredWindows );
// Prints whether the feature is available.
if ( myVersion != nullptr )
{
textBox1->Text = "Layered windows feature is installed.\n";
}
else
{
textBox1->Text = "Layered windows feature is not installed.\n";
}
// This is an alternate way to check whether a feature is present.
if ( OSFeature::Feature->IsPresent( OSFeature::LayeredWindows ) )
{
textBox1->Text = String::Concat( textBox1->Text,
"Again, layered windows feature is installed." );
}
else
{
textBox1->Text = String::Concat( textBox1->Text,
"Again, layered windows feature is not installed." );
}
}
private void LayeredWindows() {
// Gets the version of the layered windows feature.
Version myVersion = OSFeature.Feature.GetVersionPresent(OSFeature.LayeredWindows);
// Prints whether the feature is available.
if (myVersion != null)
textBox1.Text = "Layered windows feature is installed." + '\n';
else
textBox1.Text = "Layered windows feature is not installed." + '\n';
// This is an alternate way to check whether a feature is present.
if (OSFeature.Feature.IsPresent(OSFeature.LayeredWindows))
textBox1.Text += "Again, layered windows feature is installed.";
else
textBox1.Text += "Again, layered windows feature is not installed.";
}
Private Sub LayeredWindows()
' Gets the version of the layered windows feature.
Dim myVersion As Version = _
OSFeature.Feature.GetVersionPresent(OSFeature.LayeredWindows)
' Prints whether the feature is available.
If (myVersion IsNot Nothing) Then
textBox1.Text = "Layered windows feature is installed." & _
ControlChars.CrLf
Else
textBox1.Text = "Layered windows feature is not installed." & _
ControlChars.CrLf
End If
'This is an alternate way to check whether a feature is present.
If OSFeature.Feature.IsPresent(OSFeature.LayeredWindows) Then
textBox1.Text &= "Again, layered windows feature is installed."
Else
textBox1.Text &= "Again, layered windows feature is not installed."
End If
End Sub
Observações
Quando implementado numa classe, IFeatureSupport fornece métodos que pode usar para determinar se uma funcionalidade está atualmente instalada no sistema e para obter o número de versão dessa funcionalidade. Ligue IsPresent para determinar se uma funcionalidade, ou uma versão específica de uma funcionalidade, está atualmente instalada. Ligue GetVersionPresent para determinar o número de versão de uma funcionalidade instalada.
Consulte as FeatureSupport classes e OSFeature para implementações desta interface.
Métodos
| Name | Description |
|---|---|
| GetVersionPresent(Object) |
Recupera a versão da funcionalidade especificada. |
| IsPresent(Object, Version) |
Determina se a versão especificada ou mais recente da funcionalidade especificada está atualmente disponível no sistema. |
| IsPresent(Object) |
Determina se alguma versão da funcionalidade especificada está atualmente disponível no sistema. |