FeatureSupport Sınıf

Tanım

static Geçerli sistemden özellik bilgilerini almak için yöntemler sağlar.

public ref class FeatureSupport abstract : System::Windows::Forms::IFeatureSupport
public abstract class FeatureSupport : System.Windows.Forms.IFeatureSupport
type FeatureSupport = class
    interface IFeatureSupport
Public MustInherit Class FeatureSupport
Implements IFeatureSupport
Devralma
FeatureSupport
Türetilmiş
Uygulamalar

Örnekler

Aşağıdaki örnek, özelliği için OSFeatureFeatureSupport ve sorgularının LayeredWindows uygulamasını kullanır. Sürüm, özelliğin mevcut olup olmadığını belirlemek için olup olmadığını nullgörmek için denetlendi. Sonuç bir metin kutusunda görüntülenir. Bu kod, oluşturulduğunu ve bir forma yerleştirildiğini varsayar 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

Açıklamalar

static Özellik bilgileri için sorguladığınız sınıflar arabirimi uygularken bu sınıfın IFeatureSupport yöntemlerini kullanın. Aksi takdirde, öğesini FeatureSupport devralın ve kendi uygulamanızı sağlayın. Bu sınıfın uygulanması için bkz OSFeature. .

Bir özelliğin sürüm numarasını almak için öğesini çağırın GetVersionPresent. Belirli bir özelliğin veya özelliğin sürümünün yüklü olup olmadığını belirlemek için çağrısı IsPresent .

Uygulayanlara Notlar

öğesinden FeatureSupportdevraldığınızda yöntemini geçersiz kılmanız GetVersionPresent(String, String) gerekir. Bu yöntemi geçersiz kıldığınızda, parametresi için kullandığınız sınıfın feature yönteminde IsPresent(String, String) bu parametre için kullanılan sınıfla aynı olup olmadığını denetleyin. İki feature parametre farklıysa, öğesini de geçersiz kılmanız IsPresent(String, String)gerekir.

Oluşturucular

Name Description
FeatureSupport()

FeatureSupport sınıfının yeni bir örneğini başlatır.

Yöntemler

Name Description
Equals(Object)

Belirtilen nesnenin geçerli nesneye eşit olup olmadığını belirler.

(Devralındığı yer: Object)
GetHashCode()

Varsayılan karma işlevi işlevi görür.

(Devralındığı yer: Object)
GetType()

Geçerli örneğin Type alır.

(Devralındığı yer: Object)
GetVersionPresent(Object)

Türetilmiş bir sınıfta geçersiz kılındığında, belirtilen özelliğin sistemde kullanılabilen sürümünü alır.

GetVersionPresent(String, String)

Belirtilen özelliğin sistemde kullanılabilen sürümünü alır.

IsPresent(Object, Version)

Belirtilen özelliğin belirtilen veya daha yeni sürümünün sistemde yüklü olup olmadığını belirler.

IsPresent(Object)

Belirtilen özelliğin herhangi bir sürümünün sistemde yüklü olup olmadığını belirler.

IsPresent(String, String, Version)

Belirtilen özelliğin belirtilen veya daha yeni sürümünün sistemde yüklü olup olmadığını belirler. Bu yöntem şeklindedir static.

IsPresent(String, String)

Belirtilen özelliğin herhangi bir sürümünün sistemde yüklü olup olmadığını belirler. Bu yöntem şeklindedir static.

MemberwiseClone()

Geçerli Objectbasit bir kopyasını oluşturur.

(Devralındığı yer: Object)
ToString()

Geçerli nesneyi temsil eden bir dize döndürür.

(Devralındığı yer: Object)

Şunlara uygulanır

Ayrıca bkz.