OSFeature.Feature Propriedade

Definição

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.

Aplica-se a

Ver também