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

Determines whether the specified or newer version of the specified feature is currently available on the system.

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

Parameters

featureClassName
The name of the class that contains information about the specified feature. The specified class must implement IFeatureSupport. To determine the name of the class to query for feature information, see documentation for the product containing the feature.
featureConstName
The name of the feature to look for. To determine this name, see documentation for the product containing the feature.
minimumVersion
A Version representing the minimum version of the feature to look for.

Return Value

true if the feature is present and its version is greater than or equal to the specified minimum version; false if the feature is not present or its version is below the specified minimum or if the product containing the feature is not installed.

Example [Visual Basic]

The following example determines whether version 1.1.1 of the LAYERED_WINDOWS feature of the operating system is present and displays the result in a label. This code assumes Label1 has been placed on the form.

First, a new Version that represents version 1.1.1 is created. Then, IsPresent is called, with OSFeature specifying the class to query for information, LAYERED_WINDOWS specifying the feature to look for, and the Version object representing version 1.1.1 specifying the version to look for. The result of the query is displayed in Label1.

[Visual Basic]

Private Sub Label1_Click(ByVal sender As System.Object, ByVal e As System.EventArgs)
   ' Declare a VersionNumber.
   Dim myVersionNumber as VersionNumber
   ' Create a VersionNumber containing version 1.1.1.
   myVersionNumber = new VersionNumber(1, 1, 1)
   ' Determine whether the device context limited feature is present and display the results. 
   Label1.Text = FeatureSupport.IsPresent("System.WinForms.OSFeature", "System.Winforms.OSFeature.LAYERED_WINDOWS", myVersionNumber)
End Sub

See Also

FeatureSupport Class | FeatureSupport Members | System.WinForms Namespace | FeatureSupport.IsPresent Overload List | GetVersionPresent