MobileCapabilities.HasCapability(String, String) Method
Definition
Important
Some information relates to prerelease product that may be substantially modified before it’s released. Microsoft makes no warranties, express or implied, with respect to the information provided here.
Provides a uniform way to evaluate device capabilities. This method is used internally by ASP.NET to implement various device-selection criteria expressed in the syntax of the controls. For example, this method is used to choose among <Choice> Element (.NET Framework Developer's Guide) elements in a DeviceSpecific/Choice construct. This API is obsolete. For information about how to develop ASP.NET mobile applications, see Mobile Apps & Sites with ASP.NET.
public:
bool HasCapability(System::String ^ delegateName, System::String ^ optionalParameter);
public bool HasCapability (string delegateName, string optionalParameter);
member this.HasCapability : string * string -> bool
Public Function HasCapability (delegateName As String, optionalParameter As String) As Boolean
Parameters
- delegateName
- String
The device evaluation method, property name, or item in the capabilities collection.
- optionalParameter
- String
The optional argument.
Returns
true
if the device has the specified capability; otherwise, false
.
Exceptions
A capabilityName
parameter is not found as a device-filter name specified in the configuration file, as a MobileCapabilities property, or as an item in the MobileCapabilities Item collection.
delegateName
is null
or empty.
Remarks
Applications can use the HasCapability method programmatically when they gather device-specific information. If the capabilityName
parameter specifies a device evaluation method, the optionalArgument
parameter is passed to this method. If the capabilityName
parameter specifies a property name or item in the capabilities dictionary, the HasCapability method checks whether the property or item is equal to the optionalArgument
parameter.
Applies to
See also
Feedback
https://aka.ms/ContentUserFeedback.
Kommer snart: I hele 2024 udfaser vi GitHub-problemer som feedbackmekanisme for indhold og erstatter det med et nyt feedbacksystem. Du kan få flere oplysninger under:Indsend og få vist feedback om