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 OSFeatureLayeredWindows ve sorgularının FeatureSupport uygulamasını kullanır. Sürüm, özelliğin mevcut olup nullolmadığını belirlemek için olup olmadığını gö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 arabirimini uyguladığında 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 çağrısında bulunur GetVersionPresent. Belirli bir özelliğin veya özelliğin sürümünün yüklü olup olmadığını belirlemek için çağrısında IsPresent bulunur.

Uygulayanlara Notlar

'den 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 yönteminde feature bu parametre için kullanılan sınıfla IsPresent(String, String) aynı olup olmadığını denetleyin. İki feature parametre farklıysa, öğesini de geçersiz kılmanız IsPresent(String, String)gerekir.

Oluşturucular

FeatureSupport()

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

Yöntemler

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()

Type Geçerli örneğini 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)

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

IsPresent(Object, Version)

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

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.

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.

MemberwiseClone()

Geçerli Objectöğesinin sığ bir kopyasını oluşturur.

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

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

(Devralındığı yer: Object)

Şunlara uygulanır

Ayrıca bkz.