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

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

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

Parameters

featureClassName
The name of the class to query for information about the specified feature. This class must implement IFeatureSupport.
featureConstName
The name of the feature to look for.

Return Value

A Version representing the version of the specified feature available on the system. If the feature is present but does not have a version associated with it, such as a feature that can be present or absent, System.WinForms.VersionNumber.ZERO will be returned. If the feature is not present in any version or the class containing information about the feature could not be loaded, System.WinForms.VersionNumber.INVALID will be returned.

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.

[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 | FeatureSupport.GetVersionPresent Overload List | GetVersionPresent | IsPresent