IAttributes80
This interface gives the client access to all of a data source’s available attributes.
|
Properties |
|
|
Gets the IAttribute80 element in the specified zero-based index. |
|
|
Gets the number of attributes the data source has. |
|
|
Sets a Boolean that determines if all of a data source’s attributes are to be imported. |
|
|
Gets the IAttribute80 element in the specified zero-based index. |
|
|
Methods |
|
|
Creates a new attribute. |
|
|
Checks whether a particular layer attribute exists. |
Attribute
Gets the IAttribute80 element in the specified zero-based index. This property is exposed in C# and JavaScript in the following ways:
§ In C#, this property is exposed as Attribute, e.g.,
IAttributes80.Attribute["Name"] = "Paris";
Note: In older versions of C#, this property is exposed as set_Attribute and get_Attribute, e.g.,
IAttributes80.set_Attribute["Name"] = "Paris";
§ In JavaScript use:
IAttributes80.Attribute("Name") = "Paris";
JavaScript |
|
|
|
Attribute(AttributeName) |
C# |
|
string Attribute { get; set; } |
C++ |
|
|
|
HRESULT Attribute( [in] BSTR AttributeName, [out, retval] BSTR* pVal) HRESULT Attribute( [in] BSTR AttributeName, [in] BSTR pVal) |
Count
Gets the number of attributes the data source has.
JavaScript |
|
Count |
C# |
|
int Count { get; } |
C++ |
|
HRESULT Count([out, retval] long* pVal) |
ImportAll
Sets a Boolean that determines if all of a data source’s attributes are to be imported.
JavaScript |
|
ImportAll |
C# |
|
bool ImportAll { set; } |
C++ |
|
HRESULT ImportAll([in] VARIANT_BOOL rhs) |
Item
Gets the IAttribute80 element in the specified zero-based index.
To access a specific element use the following syntax: IAttributes80(index).
C# exposes this property as an indexer accessed using the following syntax: IAttributes80[index].
JavaScript |
|
Item( Index) |
C# |
|
dynamic this[object Index] { get; } |
C++ |
|
HRESULT Item( [in] VARIANT Index, [out, retval] VARIANT* pVal) |
CreateAttribute
Creates a new layer attribute. If an attribute name in uppercase is passed for a layer type that doesn’t support upper case attribute names (e.g., SQLite), the casing is automatically changed to lowercase (e.g., AttributeName > attributename), and an exception is returned informing you of the change.
JavaScript |
|
CreateAttribute( AttributeName, attributeType, Size, Precision) |
C# |
|
void CreateAttribute( string AttributeName, AttributeTypeCode attributeType, int Size, int Precision = 15) |
C++ |
|
HRESULT CreateAttribute( BSTR AttributeName, AttributeTypeCode attributeType, long Size, long Precision) |
Parameters
AttributeName
A string that holds the attribute’s name.
attributeType
An enum that determines the attribute type. The following are the possible values:
· AT_UNKNOWN = -1
· AT_TEXT = 0
· AT_INTEGER = 1
· AT_DOUBLE = 2
Size
The size of the attribute (character length).
Precision
The number of decimal places. This property has effect only if the attributeType property is set to AT_DOUBLE.
Exceptions
If an attribute name in uppercase is passed for a layer type that doesn’t support upper case attribute names (e.g., SQLite), the casing is automatically changed to lowercase, and the exception “Attribute name changed” is returned informing you of the change.
See: HRESULT Return Values for a list of possible values returned by the HRESULT.
IsAttributeExist
Returns whether a specified layer attribute exists.
JavaScript |
|
IsAttributeExist( AttributeName) |
C# |
|
bool IsAttributeExist( string AttributeName) |
C++ |
|
HRESULT IsAttributeExist( BSTR AttributeName, VARIANT_BOOL* bExist) |
Parameters
AttributeName
A string that holds the attribute’s name.
Return Value
bExist
A Boolean that determines if the attribute exists.
Exceptions
See: HRESULT Return Values for a list of possible values returned by the HRESULT.