STK ObjectsSend comments on this topic.
Metadata Property (IAgStkObject)
See Also
Windows





Windows & Linux

Description

Gets the object's metadata. Metadata is a collection of keys and their associated values.

Property type

Read-only property

Syntax

[Visual Basic .NET]
Public Property Metadata() As IAgKeyValueCollection
[C#]
public IAgKeyValueCollection Metadata {get;}
[Managed C++]
public: __property IAgKeyValueCollection ^ get_Metadata();
[Unmanaged C++]
public: HRESULT get_Metadata(
    IAgKeyValueCollection ** ppRetVal
);
[Java]
public IAgKeyValueCollection getMetadata();
[Python - STK API ]
@property
def Metadata(self) -> "IAgKeyValueCollection":

See Also

Example

Add Metadata To Object
[C#]
stkObject.Metadata.Set("key", "value");
Add ReadOnly Metadata To Object
[C#]
stkObject.Metadata.Set("key", "value");
stkObject.Metadata.SetReadOnly("key", true);
Remove Metadata From Object
[C#]
stkObject.Metadata.RemoveKey("key");
Iterate Metadata Keys
[C#]
foreach (string key in stkObject.Metadata.Keys)
{
    Console.WriteLine("Key: {0}, Value: {1}", key, stkObject.Metadata[key]);
}
Check If Metadata Is ReadOnly
[C#]
if (stkObject.Metadata.GetReadOnly("test"))
{
    Console.WriteLine("The test Metadata element is ReadOnly.");
}
Check If Metadata Contains Key
[C#]
if (stkObject.Metadata.Contains("test"))
{
    Console.WriteLine("The collection contains the test element.");
}
Add Metadata To Object
[Visual Basic .NET]
stkObject.Metadata.[Set]("key", "value")
Add ReadOnly Metadata To Object
[Visual Basic .NET]
stkObject.Metadata.[Set]("key", "value")
stkObject.Metadata.SetReadOnly("key", True)
Remove Metadata From Object
[Visual Basic .NET]
stkObject.Metadata.RemoveKey("key")
Iterate Metadata Keys
[Visual Basic .NET]
For Each key As String In stkObject.Metadata.Keys
	Console.WriteLine("Key: {0}, Value: {1}", key, stkObject.Metadata(key))
Next
Check If Metadata Is ReadOnly
[Visual Basic .NET]
If stkObject.Metadata.GetReadOnly("test") Then
	Console.WriteLine("The test Metadata element is ReadOnly.")
End If
Check If Metadata Contains Key
[Visual Basic .NET]
If stkObject.Metadata.Contains("test") Then
	Console.WriteLine("The collection contains the test element.")
End If
© 2024 Analytical Graphics, Inc. All Rights Reserved.