OSFeature.GetVersionPresent(Object) Método

Definição

Recupera a versão da funcionalidade especificada atualmente disponível no sistema.

public:
 override Version ^ GetVersionPresent(System::Object ^ feature);
public override Version GetVersionPresent(object feature);
override this.GetVersionPresent : obj -> Version
Public Overrides Function GetVersionPresent (feature As Object) As Version

Parâmetros

feature
Object

A funcionalidade cuja versão é solicitada, ou LayeredWindows .Themes

Devoluções

A Version representa a versão da funcionalidade do sistema operativo especificada atualmente disponível no sistema; ou null se a funcionalidade não for encontrada.

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 a Feature propriedade, a static instância de OSFeature fornecida nesta classe, para consultar o número de versão de uma funcionalidade.

Aplica-se a

Ver também