MobileCapabilities.HasCapability Method

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.

Namespace: System.Web.Mobile
Assembly: System.Web.Mobile (in system.web.mobile.dll)

No code example is currently available or this language may not be supported.
public boolean HasCapability (
	String delegateName, 
	String optionalParameter
)
public function HasCapability (
	delegateName : String, 
	optionalParameter : String
) : boolean
Not applicable.

Parameters

delegateName

The device evaluation method, property name, or item in the capabilities collection.

optionalParameter

The optional argument.

Return Value

true if the device has the specified capability; otherwise, false.

Exception typeCondition

ArgumentOutOfRangeException

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.

ArgumentException

delegateName is a null reference (Nothing in Visual Basic) or empty.

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.

Windows 98, Windows Server 2000 SP4, Windows Millennium Edition, Windows Server 2003, Windows XP Media Center Edition, Windows XP Professional x64 Edition, Windows XP SP2, Windows XP Starter Edition

The Microsoft .NET Framework 3.0 is supported on Windows Vista, Microsoft Windows XP SP2, and Windows Server 2003 SP1.

.NET Framework

Supported in: 3.0, 2.0, 1.1

Community Additions

ADD
Show: