Contents

concerns

The Contents property returns a Variant that stores the serialized data of the PropertyBag or sets the contents of the PropertyBag.

 

Syntax

Contents

Return value

Type

Description

Variant

The serialized data of the PropertyBag

Parameter

None

Example:

 

Dim Bag1 As New TCEServer.PropertyBag

 

#Write some properties in the bag

Bag1.WriteProperty("Name1", "Adam")

Bag1.WriteProperty("Name2", "James")

Bag1.WriteProperty("Name3", "John")

Bag1.WriteProperty("Count", 3)

 

Dim BagSerialized As Variant

 

#save the content of the bag in a variant

BagSerialized := Bag1.Contents

 

#create another property bag

 

Dim Bag2 As New TCEServer.PropertyBag

 

#load the content of bag2 with bag1

Bag2.Contents := BagSerialized

 

#output the name2; output will be James

MsgBox(Bag2.ReadProperty("Name2"))