IFeatureSupport Interface

Definitie

Hiermee geeft u een standaardinterface voor het ophalen van functiegegevens van het huidige systeem.

public interface class IFeatureSupport
public interface IFeatureSupport
type IFeatureSupport = interface
Public Interface IFeatureSupport
Afgeleid

Voorbeelden

In het volgende voorbeeld wordt de OSFeature implementatie van IFeatureSupport en query's voor de LayeredWindows functie gebruikt. De versie wordt gecontroleerd om te zien of deze is null, om te bepalen of de functie aanwezig is. Het resultaat wordt weergegeven in een tekstvak. Bij deze code wordt ervan uitgegaan dat textBox1 deze is gemaakt en op een formulier is geplaatst.

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

Opmerkingen

Wanneer deze is geïmplementeerd in een klasse, IFeatureSupport kunt u methoden gebruiken om te bepalen of een functie momenteel op het systeem is geïnstalleerd en om het versienummer van een functie op te halen. Aanroep IsPresent om te bepalen of een functie, of een specifieke versie van een functie, momenteel is geïnstalleerd. Aanroep GetVersionPresent om het versienummer van een geïnstalleerde functie te bepalen.

Bekijk de FeatureSupport en OSFeature klassen voor implementaties van deze interface.

Methoden

Name Description
GetVersionPresent(Object)

Haalt de versie van de opgegeven functie op.

IsPresent(Object, Version)

Bepaalt of de opgegeven of nieuwere versie van de opgegeven functie momenteel beschikbaar is op het systeem.

IsPresent(Object)

Bepaalt of een versie van de opgegeven functie momenteel beschikbaar is op het systeem.

Van toepassing op

Zie ook