KitchenDraw SDK 2
Show / Hide Table of Contents

Property CustomInfo

CustomInfo

Provides access to the scenes's custom data area dedicated wholely to the application extensions.

Declaration
public ICustomInfoDictionary CustomInfo { get; }
Property Value
Type Description
ICustomInfoDictionary
Remarks

This data allows plugin functions to store in the scene some custom configuration variables. Since this data is stored as key-value pairs, each wizard or plugin function can isolate its own variables from other ones.

These specific character strings appear in the XML file that is generated by the "File|Export|Management data (.XML)" command; each one under a tag equal to the key with node text set to value.

Examples
// This snippet shows how to read and how to write custom 
// data into insitu scene

// Important Note 1:
// The CustomInfo is shared between the plugins. 
// So it’s essential to choose unique names not to overwrite foreign plugin data accidentally. 
// For the same reason it’s strongly not recommended to write any data with no key. 
// CustomInfo is widely used and your plugin likely won’t be the only plugin reading/writing there.

// Important Note 2:
// The data placed in CustomInfo is exported to the scene xml file.
// Every CustomInfo key becomes an xml element in the exported file. 
// Because of that, if you choose a name which is not allowed for xml elements 
// (e.g. you use slash or quotes in your key), the exported xml file will be malformed.

scene.CustomInfo["put_you_key1_here"] = "put any string data 1 here";
scene.CustomInfo["put_you_key2_here"] = "put any string data 2 here";

Console.WriteLine(scene.CustomInfo["put_you_key1_here"]);
Console.WriteLine(scene.CustomInfo["put_you_key2_here"]);

// The entire custom info can be accessed by providing an empty string key
// it is formated as an xml content
Console.WriteLine(scene.CustomInfo[""]);
In this article
Back to top Generated by DocFX