System.Devices.TDeviceInfo.AddAttribute

From RAD Studio API Documentation
Jump to: navigation, search

Delphi

procedure AddAttribute(const Key, Value: string);

C++

void __fastcall AddAttribute(const System::UnicodeString Key, const System::UnicodeString Value);

Properties

Type Visibility Source Unit Parent
procedure
function
public
System.Devices.pas
System.Devices.hpp
System.Devices TDeviceInfo

Description

Adds an attribute with the specified key and value to the device.

To define the display name of your device in the RAD Studio IDE, add an attribute to your device with sDevAttrDisplayName as key and the desired display name as value.

If an attribute with the specified key already exists, AddAttribute raises an EInvalidOpException exception with the following message:

Attribute '<key>' already exists

Use HasAttribute to check whether or not an attribute with a given key already exists.

See Also