Kanzi  3.9.9
Kanzi Studio plugin API
Property Interface Reference

Access and configure property types. More...

Inheritance diagram for Property:
[legend]
Collaboration diagram for Property:
[legend]

Public Member Functions

IEnumerable< PropertyEditorGetCompatiblePropertyEditors ()
 

Properties

bool AffectLayout [get, set]
 Gets or sets whether the property affects node layout. More...
 
bool AffectRender [get, set]
 Gets or sets whether the property affects node rendering. More...
 
string Category [get, set]
 Gets or sets the category in which Kanzi Studio shows the property type in the Properties and Add Properties windows. More...
 
Type DataType [get]
 Gets the data type of the property type. More...
 
object DefaultValue [get, set]
 Gets or sets the default value of the property type. More...
 
string Description [get, set]
 Gets or sets the description of the purpose the property type. More...
 
string DisplayName [get, set]
 Gets or sets the name of the property type the way Kanzi Studio shows it. More...
 
PropertyEditor Editor [get, set]
 Gets or sets the editor that lets Kanzi Studio users set the value of the property in the Properties window. More...
 
bool IsCustomOrPluginPropertyType [get]
 
bool IsHidden [get, set]
 Gets or sets whether Kanzi Studio hides the property type in the Add Properties window and Add Property context menu. More...
 
bool IsInherited [get, set]
 Gets or sets whether nodes can inherit from their ancestor nodes the value of this property. More...
 
bool IsMessageArgument [get]
 Gets whether you can use the property type as an argument of an action in Kanzi Studio. More...
 
bool IsVisibleToRuntime [get, set]
 Gets or sets whether Kanzi Studio exports the property to Kanzi Engine. More...
 
string LocalName [get]
 Gets the name of the property type without the property type namespace. More...
 
string Name [get, set]
 Gets or sets the name of the property type. More...
 
PropertyReadOnlyStatus ReadOnlyStatus [get]
 Gets a status that tells you whether the property type can be modified. More...
 
int SortingIndex [get, set]
 Gets or sets the sorting index of the property. More...
 
string ToolTip [get, set]
 Gets or sets the tooltip that Kanzi Studio shows for the property type in the Properties and Add Properties windows. More...
 
IEnumerable< Type > UserAddableHostTypes [get, set]
 Gets or sets the node types to which Kanzi Studio users can add this property. More...
 

Detailed Description

Access and configure property types.

See also
PropertyTypeLibrary, PropertyEditor

Examples

To create and configure a float property type:

public void Execute(PluginCommandParameter parameter)
{
// Get the Property Types library in the project.
var propertyTypesLibrary = studio.ActiveProject.PropertyTypeLibrary;
// Create a float property type in the Property Types library and set:
// - Name to MyPlugin.MyFloatProperty
// Use the name of your plugin as the property type namespace to avoid naming conflicts with other property
// types in the Kanzi Studio project that use the project name as the default property type namespace.
// - Name as it is shown in Kanzi Studio to My Float Property
// - Category in which Kanzi Studio shows the property type to My Plugin Properties
// - Lowest value to 0.0
// - Highest value to 100.0
// - The amount by which the property can change to 1.0
var myFloatProperty = propertyTypesLibrary.CreateFloatProperty(
propertyTypesLibrary.GenerateUniqueChildName("MyPlugin.MyFloatProperty"),
"My Float Property",
"My Plugin Properties",
0.0f,
100.0f,
1.0f);
// Set the Editor property of the property type to Slider.
// This way you enable the Kanzi Studio user to set the value of this property using a slider.
if (PropertyEditors.Slider.IsCompatibleWith(myFloatProperty))
{
myFloatProperty.Editor = PropertyEditors.Slider;
}
// Set the default value of the property to 50.
myFloatProperty.DefaultValue = 50.0f;
// Print to the Log window a notification about creating the property type.
studio.Log("Created a new property type " + myFloatProperty.Name + " in category " + myFloatProperty.Category + ".");
}

Property Documentation

bool AffectLayout
getset

Gets or sets whether the property affects node layout.

When you set AffectLayout to true and the value of the property changes on a node, Kanzi recalculates the layout for that node. Note that recalculating the layout decreases application performance.

bool AffectRender
getset

Gets or sets whether the property affects node rendering.

When you set AffectRender to true and the value of the property changes on a node, Kanzi updates the rendering for that node. If the property does not affect layout or size, you must set AffectRender to true to see the effect you want to achieve with this property.

string Category
getset

Gets or sets the category in which Kanzi Studio shows the property type in the Properties and Add Properties windows.

Use the Category property to help Kanzi Studio users quickly find your property types.

Type DataType
get

Gets the data type of the property type.

object DefaultValue
getset

Gets or sets the default value of the property type.

string Description
getset

Gets or sets the description of the purpose the property type.

Use the Description property to document the properties in your project.

string DisplayName
getset

Gets or sets the name of the property type the way Kanzi Studio shows it.

See also
LocalName, Name
PropertyEditor Editor
getset

Gets or sets the editor that lets Kanzi Studio users set the value of the property in the Properties window.

bool IsHidden
getset

Gets or sets whether Kanzi Studio hides the property type in the Add Properties window and Add Property context menu.

Kanzi Studio shows hidden property types in the Library > Property Types.

bool IsInherited
getset

Gets or sets whether nodes can inherit from their ancestor nodes the value of this property.

bool IsMessageArgument
get

Gets whether you can use the property type as an argument of an action in Kanzi Studio.

Kanzi Studio users cannot add to nodes those properties that are action arguments.

bool IsVisibleToRuntime
getset

Gets or sets whether Kanzi Studio exports the property to Kanzi Engine.

string LocalName
get

Gets the name of the property type without the property type namespace.

Use the LocalName to access the property type in bindings and shaders.

See also
Name, DisplayName
string Name
getset

Gets or sets the name of the property type.

See also
DisplayName, LocalName
PropertyReadOnlyStatus ReadOnlyStatus
get

Gets a status that tells you whether the property type can be modified.

Returns
One of these values:
  • NotReadonly for property types created in the Kanzi Studio project. Kanzi Studio users can modify these property types.
  • UserInterfaceReadonly for property types created in runtime metadata in Kanzi Engine or in a Kanzi Engine plugin. Kanzi Studio users cannot modify these property types.
  • ProgrammaticallyReadonly for read-only property types created in runtime metadata in Kanzi Engine or in a Kanzi Engine plugin. You cannot modify these property types.
int SortingIndex
getset

Gets or sets the sorting index of the property.

Sorting indices determine the order in which Kanzi Studio shows properties in the Properties window. Kanzi Studio orders alphabetically those properties that have the same sorting index.

string ToolTip
getset

Gets or sets the tooltip that Kanzi Studio shows for the property type in the Properties and Add Properties windows.

Use the ToolTip property to explain to Kanzi Studio users what the property type does and how to use it.

IEnumerable<Type> UserAddableHostTypes
getset

Gets or sets the node types to which Kanzi Studio users can add this property.