IFeatureSupport.IsPresent 메서드

정의

지정된 기능을 시스템에서 현재 사용할 수 있는지 여부를 확인합니다.

오버로드

IsPresent(Object)

지정된 기능의 임의의 버전을 시스템에서 현재 사용할 수 있는지 여부를 확인합니다.

IsPresent(Object, Version)

지정된 기능의 새 버전이나 지정된 버전을 시스템에서 현재 사용할 수 있는지 여부를 확인합니다.

IsPresent(Object)

지정된 기능의 임의의 버전을 시스템에서 현재 사용할 수 있는지 여부를 확인합니다.

public:
 bool IsPresent(System::Object ^ feature);
public bool IsPresent (object feature);
abstract member IsPresent : obj -> bool
Public Function IsPresent (feature As Object) As Boolean

매개 변수

feature
Object

찾을 기능입니다.

반환

기능이 존재하면 true이고 존재하지 않으면 false입니다.

예제

다음 예제에서는 합니다 OSFeature 구현의 IFeatureSupport 에 대 한 쿼리는 LayeredWindows 기능입니다. 버전을 확인 하는 경우 확인 null을 기능이 있는지 여부를 결정 합니다. 결과 텍스트 상자에 표시 됩니다. 이 코드에서는 가정 textBox1 생성 되어 폼에 배치 합니다.

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

추가 정보

적용 대상

IsPresent(Object, Version)

지정된 기능의 새 버전이나 지정된 버전을 시스템에서 현재 사용할 수 있는지 여부를 확인합니다.

public:
 bool IsPresent(System::Object ^ feature, Version ^ minimumVersion);
public bool IsPresent (object feature, Version minimumVersion);
abstract member IsPresent : obj * Version -> bool
Public Function IsPresent (feature As Object, minimumVersion As Version) As Boolean

매개 변수

feature
Object

찾을 기능입니다.

minimumVersion
Version

찾을 기능의 최소 버전 번호를 나타내는 Version입니다.

반환

요청한 기능 버전이 존재하면 true이고 존재하지 않으면 false입니다.

예제

다음 예제에서는 합니다 OSFeature 구현의 IFeatureSupport 에 대 한 쿼리는 LayeredWindows 기능입니다. 버전을 확인 하는 경우 확인 null을 기능이 있는지 여부를 결정 합니다. 결과 텍스트 상자에 표시 됩니다. 이 코드에서는 가정 textBox1 생성 되어 폼에 배치 합니다.

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

추가 정보

적용 대상