Kanzi  3.9.4
Kanzi Studio API
PropertyEditor Interface Reference

Access property editors. More...

Public Member Functions

bool IsCompatibleWith (Property property)
 Whether you can use a property editor to set the value of a property. More...
 

Properties

string Name [get]
 Gets the name of the property editor. More...
 

Detailed Description

Access property editors.

Use property editors to enable Kanzi Studio users to set values for properties.

See also
Property, PropertyTypeLibrary

Member Function Documentation

◆ IsCompatibleWith()

bool IsCompatibleWith ( Property  property)

Whether you can use a property editor to set the value of a property.

Parameters
propertyThe property for which you want to check whether you can use the property editor.
Returns
True if you can use the property editor to set the value of the property, otherwise false.

Examples

To check whether you can use a property editor to set the value of a property:

public void Execute(PluginCommandParameter parameter)
{
// Get the Property Types library in the project.
var propertyTypesLibrary = studio.ActiveProject.PropertyTypeLibrary;
// Create an integer property type in the Property Types library and set:
// - Name to MyPlugin.MyIntProperty
// 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 Int Property
// - Category in which Kanzi Studio shows the property type to My Plugin Properties
// - Lowest value to 0
// - Highest value to 9000
// - The amount by which the property can change to 10
var myIntProperty = propertyTypesLibrary.CreateIntProperty(
propertyTypesLibrary.GenerateUniqueChildName("MyPlugin.MyIntProperty"),
"My Int Property",
"My Plugin Properties",
0,
9000,
10);
// 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(myIntProperty))
{
myIntProperty.Editor = PropertyEditors.Slider;
}
}

Property Documentation

◆ Name

string Name
get

Gets the name of the property editor.