Kanzi 3.9.10
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.
 
bool AffectRender [get, set]
 Gets or sets whether the property affects node rendering.
 
string Category [get, set]
 Gets or sets the category in which Kanzi Studio shows the property type in the Properties and Add Properties windows.
 
Type DataType [get]
 Gets the data type of the property type.
 
object DefaultValue [get, set]
 Gets or sets the default value of the property type.
 
string Description [get, set]
 Gets or sets the description of the purpose the property type.
 
string DisplayName [get, set]
 Gets or sets the name of the property type the way Kanzi Studio shows it.
 
PropertyEditor Editor [get, set]
 Gets or sets the editor that lets Kanzi Studio users set the value of the property in the Properties window.
 
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.
 
bool IsInherited [get, set]
 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.
 
bool IsVisibleToRuntime [get, set]
 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.
 
string Name [get, set]
 Gets or sets the name of the property type.
 
PropertyReadOnlyStatus ReadOnlyStatus [get]
 Gets a status that tells you whether the property type can be modified.
 
intSortingIndex [get, set]
 Gets or sets the sorting index of the property.
 
string ToolTip [get, set]
 Gets or sets the tooltip that Kanzi Studio shows for the property type in the Properties and Add Properties windows.
 
IEnumerable< TypeUserAddableHostTypes [get, set]
 Gets or sets the node types to which Kanzi Studio users can add this property.
 

Detailed Description

Access and configure property types.

See also
PropertyTypeLibrary, PropertyEditor

Examples

To create and configure a float property type:

{
// 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

◆ AffectLayout

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.

◆ AffectRender

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.

◆ Category

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.

◆ Description

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.

◆ DisplayName

string DisplayName
getset

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

See also
LocalName, Name

◆ IsHidden

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.

◆ IsMessageArgument

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.

◆ LocalName

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

◆ Name

string Name
getset

Gets or sets the name of the property type.

See also
DisplayName, LocalName

◆ ReadOnlyStatus

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.

◆ SortingIndex

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.

◆ ToolTip

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.