OSFeature.Feature Propriedade
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.
Obtém uma static instância da OSFeature classe para usar em consultas de características. Esta propriedade é somente leitura.
public:
static property System::Windows::Forms::OSFeature ^ Feature { System::Windows::Forms::OSFeature ^ get(); };
public static System.Windows.Forms.OSFeature Feature { get; }
static member Feature : System.Windows.Forms.OSFeature
Public Shared ReadOnly Property Feature As OSFeature
Valor de Propriedade
Uma instância da OSFeature classe.
Exemplos
O exemplo seguinte consulta OSFeature 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";
}
}
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";
}
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
End Sub
Observações
Use esta static propriedade para consultar funcionalidades do sistema operativo. Não podes criar uma instância desta classe.
Para determinar a versão de uma funcionalidade, chame o GetVersionPresent método. Para determinar se existe uma característica ou uma versão específica, chame o IsPresent método e especifique a característica a procurar com os identificadores de características fornecidos nesta classe.