FeatureSupport.GetVersionPresent Yöntem

Tanım

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

Aşırı Yüklemeler

Name Description
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.

GetVersionPresent(Object)

Kaynak:
FeatureSupport.cs
Kaynak:
FeatureSupport.cs
Kaynak:
FeatureSupport.cs
Kaynak:
FeatureSupport.cs
Kaynak:
FeatureSupport.cs

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

public:
 abstract Version ^ GetVersionPresent(System::Object ^ feature);
public abstract Version GetVersionPresent(object feature);
public abstract Version? GetVersionPresent(object feature);
abstract member GetVersionPresent : obj -> Version
Public MustOverride Function GetVersionPresent (feature As Object) As Version

Parametreler

feature
Object

Sürümü istenen özellik.

Döndürülenler

Version Sistemde bulunan belirtilen özelliğin sürüm numarasını temsil eden veya null özellik yüklü değilse.

Uygulamalar

Örnekler

Aşağıdaki kod örneği, ö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, bir forma oluşturulup yerleştirilmesini gerektirir 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

Sürüm numaraları üç bölümden oluşur: birincil, ikincil ve derleme. Genellikle, bir sürüm numarası "ana sayı.ikincil sayı.derleme numarası" olarak görüntülenir.

Uygulayanlara Notlar

öğesinden FeatureSupportdevraldığınızda bu yöntemi geçersiz kılmalısınız. 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ılmalısınız IsPresent(String, String).

Bu yöntemin uygulanması için bkz GetVersionPresent(Object) .

Ayrıca bkz.

Şunlara uygulanır

GetVersionPresent(String, String)

Kaynak:
FeatureSupport.cs
Kaynak:
FeatureSupport.cs
Kaynak:
FeatureSupport.cs
Kaynak:
FeatureSupport.cs
Kaynak:
FeatureSupport.cs

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

public:
 static Version ^ GetVersionPresent(System::String ^ featureClassName, System::String ^ featureConstName);
public static Version GetVersionPresent(string featureClassName, string featureConstName);
public static Version? GetVersionPresent(string featureClassName, string featureConstName);
static member GetVersionPresent : string * string -> Version
Public Shared Function GetVersionPresent (featureClassName As String, featureConstName As String) As Version

Parametreler

featureClassName
String

Belirtilen özellik hakkında bilgi sorgulamak için sınıfın tam adı. Bu sınıf arabirimini IFeatureSupport uygulamalı veya bu arabirimi uygulayan bir sınıftan devralmalıdır.

featureConstName
String

Aranacak özelliğin tam adı.

Döndürülenler

Version Belirtilen özelliğin sürüm numarası sistemde kullanılabilir olan veya null özellik yüklü değilse A.

Açıklamalar

Sürüm numaraları üç bölümden oluşur: birincil, ikincil ve derleme. Genellikle, bir sürüm numarası "ana sayı.ikincil sayı.derleme numarası" olarak görüntülenir.

ve parametrelerine geçirecek featureClassName adları belirlemek için özelliği içeren ürünün belgelerine featureConstName bakın.

Ayrıca bkz.

Şunlara uygulanır