Click or drag to resize

PropertyBag Class

Used to store string properties.
Inheritance Hierarchy
SystemObject
  SystemMarshalByRefObject
    System.Runtime.InteropServicesStandardOleMarshalObject
      BaseObject
        Easymap.AddIn.CommonPropertyBag

Namespace: Easymap.AddIn.Common
Assembly: EasyMap.AddIn (in EasyMap.AddIn.dll) Version: 12.3.0.0
Syntax
public class PropertyBag : BaseObject

The PropertyBag type exposes the following members.

Constructors
 NameDescription
Public methodPropertyBagInitializes a new instance of the PropertyBag class
Top
Properties
 NameDescription
Public propertyCount Number of items in the store
Public propertyItem Get, Set a string property by its name
Public propertyKeys Lists all keys in the propertybag
Public propertyValues Lists all values in the propertybag
Top
Methods
 NameDescription
Public methodClear Clear the list
Top
Operators
 NameDescription
Public operatorStatic member(DictionaryString, String to PropertyBag) Converts the specified DictionaryTKey, TValue to a PropertyBag structure.
Public operatorStatic member(PropertyBag to DictionaryString, String) Converts the specified PropertyBag structure to a DictionaryTKey, TValue.
Top
Remarks
First initialize new PropertyBag with your unique property caption, which identifies your property. Insert userdefined key und userdefined value in initialized PropertyBag. Set Modified.
Example
Storing properties in EMPX file
C#
private void SaveProperty()
{
    Easymap.AddIn.Common.PropertyBag bag = Application.Current.CurrentDocument.GetProperties("YourUniquePropertyCaption");
    bag["Key"] = "Value";

    Application.Current.CurrentDocument.Modified = true;
}
See Also