NGWS SDK Documentation  

This is preliminary documentation and subject to change.
To comment on this topic, please send us email at ngwssdk@microsoft.com. Thanks!

FeatureSupport.GetVersionPresent

Retrieves the version of the specified feature currently available on the system.

Overload List

Retrieves the version of the specified feature currently available on the system.

[Visual Basic] Overloads Public Shared Function GetVersionPresent(String, String) As Version
[C#] public static Version GetVersionPresent(String, String);
[C++] public: static Version* GetVersionPresent(String*, String*);
[JScript] public static function GetVersionPresent(String, String) : Version;

When overridden in a derived class, retrieves the version of the specified feature currently available on the system.

[Visual Basic] Overloads MustOverride Public Function GetVersionPresent(Object) As Version
[C#] public abstract Version GetVersionPresent(Object);
[C++] public: virtual Version* GetVersionPresent(Object*) = 0;
[JScript] public abstract function GetVersionPresent(Object) : Version;

Example [Visual Basic]

The following example calls GetVersionPresent to get the version number of the LAYERED_WINDOWS feature and displays it in a label. OSFeature specifies the class to be queried and LAYERED_WINDOWS specifies the feature to look for. This code assumes Label1 has been instantiated.

Note   This example shows how to use one of the overloaded versions of GetVersionPresent. For other examples that may be available, see the individual overload topics.

[Visual Basic]

Private Sub Label1_Click(ByVal sender As System.Object, ByVal e As System.EventArgs)
   ' Declare a VersionNumber.
   Dim myVersionNumber1 As VersionNumber
   ' Get a VersionNumber for the layered windows feature.
   myVersionNumber1 = FeatureSupport.GetVersionPresent("System.WinForms.OSFeature", "System.Winforms.OSFeature.LAYERED_WINDOWS")
   ' Display the version number.
   Label1.Text = vbnewline & myVersionNumber1.major & "." & myVersionNumber1.minor & "." & myVersionNumber1.build
End Sub

See Also

FeatureSupport Class | FeatureSupport Members | System.WinForms Namespace