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!

OSFeature.GetVersionPresent

Retrieves the version of the specified feature

currently available on the system.

[Visual Basic]
Overrides Public Function GetVersionPresent( _
   ByVal feature As Object _
) As Version
[C#]
public override Version GetVersionPresent(
   object feature
);
[C++]
public: override Version* GetVersionPresent(
   Object* feature
);
[JScript]
public override function GetVersionPresent(
   feature : Object
) : Version;

Parameters

feature
The feature whose version is requested.

Return Value

A Version representing the version of the specified operating system feature currently available on the system. If the feature does not have a version associated with it, such as a feature that is either present, or absent, then System.WinForms.Version.ZERO is returned. If the feature is not present in any version, then System.WinForms.Version.INVALID is returned.

Remarks

This class cannot be instantiated. Use feature, the static (in Visual Basic Shared) instance of OSFeature provided in this class, to query for the version number of a feature.

Example [Visual Basic]

The following example queries OSFeature for the LAYERED_WINDOWS feature. The version is checked to see if it is a null reference (in Visual Basic Nothing) to determine whether the feature is present. The result is displayed in a text box. This code assumes Button1 and TextBox1 have been instantiated.

[Visual Basic]

Private Sub LayeredWindows()
   'Get the version of the layered windows feature.
   Dim myVersion As Version
   myVersion = OSFeature.feature.GetVersionPresent(OSFeature.LAYERED_WINDOWS)

   'Print whether the feature is available.
   If (myVersion = Nothing) Then
      TextBox1.Text = "Layered windows feature is not installed."
   Else
      TextBox1.Text = "Layered windows feature is installed."
   End If
End Sub

See Also

OSFeature Class | OSFeature Members | System.WinForms Namespace | System.WinForms.Version | feature | FeatureSupport