IFeatureSupport.IsPresent 메서드

정의

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

오버로드

Name Description
IsPresent(Object)

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

IsPresent(Object, Version)

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

IsPresent(Object)

Source:
IFeatureSupport.cs
Source:
IFeatureSupport.cs
Source:
IFeatureSupport.cs
Source:
IFeatureSupport.cs
Source:
IFeatureSupport.cs

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

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

찾을 기능입니다.

반품

기능이 있으면

예제

다음 예제에서는 기능에 대한 구현 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)

Source:
IFeatureSupport.cs
Source:
IFeatureSupport.cs
Source:
IFeatureSupport.cs
Source:
IFeatureSupport.cs
Source:
IFeatureSupport.cs

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

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

추가 정보

적용 대상