Provides static (in Visual Basic Shared) methods, and specifies methods for retrieving feature information about the current system.
Object
FeatureSupport
[Visual Basic] MustInherit Public Class FeatureSupport Implements IFeatureSupport [C#] public abstract class FeatureSupport : IFeatureSupport [C++] public __gc __abstract class FeatureSupport : public IFeatureSupport [JScript] public abstract class FeatureSupport implements IFeatureSupport
Use the static (Shared) methods of this class if the classes you query for feature information implement the IFeatureSupport interface. Otherwise, inherit from FeatureSupport and provide your own implementation if the classes you query for feature information do not implement the IFeatureSupport interface. See OSFeature for an example of a class that inherits FeatureSupport.
Call the static (Shared) method GetVersionPresent to get the version number of a feature. Call the static (Shared) method IsPresent to determine whether any version, or a specified version, of a feature is present.
Notes to Inheritors: When you inherit from FeatureSupport, you must override GetVersionPresent. Unless you also override IsPresent, the class of the feature parameter passed to implementations of IsPresent in this class must be the same as the class of the feature parameter defined in your implementation of GetVersionPresent.
Namespace: System.WinForms
Assembly: System.WinForms.dll
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 VersionNumber 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 VersionNumber 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
FeatureSupport Members | System.WinForms Namespace | OSFeature