Access nodes and resources in a Kanzi Studio project.
More...
Inherits PropertyContainer, and ChildContainer.
Inherited by AbstractComposer, AbstractEnginePluginContentType, AbstractMaterialType, Animation, AnimationClipBase, ApplicationConfiguration, ApplicationConfigurationItem, BakeableTheme, BinaryShaderFormat, BindingHost, Brush, ChildNodeContainer, ComponentNodeInterface, CubemapTextureInterface, DataObject, DataSource, DerivedMaterialType, DiskRelatedItem, EnginePlugin, EnginePluginContent, EnginePluginContentType, EnginePluginFile, ExportTimeGeneratedTrajectory, ExportedPropertyContainerItem, FileSystemProjectItem, FontFamily, Guide, IBindingSource, IComposerContainer, IConcreteProjectItemLibrary, INodeEffect2DContainer, INodeEffectPrefabTemplate2D, INodePrefabTemplate, IPrefabTemplate, IRenderPassPrefabTemplate, IStyleContainer, ITriggerCondition, ImageFileSource, ImportSourceItem, KzbSource, Material, MeshBase, Node, NodeComponent, NodeComponentHost, NodeEffect2D, NodeEffectPrefab2D, NodeResource, ObjectSource, ObservableFile, OrderedChildNodeContainer, OutputMaterial, PageTransition, PageTransitionAnimation, PageTransitionCollection, PrefabPlaceholder, PrefabTemplate, Project, ProjectItemLibrary< out T >, RenderPassPrefab, RenderTarget, ResourceDictionaryItem, Shader, Shortcut, SingleTextureInterface, State, StateGroup, StateManager, StudioPluginItem, StyleItem, Tag, Texture, TimelineEntry, TimelineEntryTarget, TimelineSequence, Trajectory, TriggerActionItem, TriggerConditionItem, and WriteLogActionForwardArgument.
|
| void | AddProperty (Property property) |
| | Adds a property to an item.
|
| |
| void | AddProperty (string propertyName) |
| | Adds a property to an item.
|
| |
| void | BeginBatchModification (string batchName) |
| |
| bool | CanAddProperty (Property property) |
| | Checks whether Kanzi Studio allows you to add a specific property to an item.
|
| |
| bool | CanAddProperty (string propertyName) |
| | Checks whether Kanzi Studio allows you to add a specific property to an item.
|
| |
| void | CommitBatchModification () |
| |
| bool | Delete () |
| | Deletes a project item.
|
| |
| void | DeregisterThumbnailUser (object user) |
| | Deregisters a registerd thumbnail user.
|
| |
| IEnumerable< Property > | GetAddableProperties () |
| | Gets a list of properties which you can add to an item.
|
| |
| T | GetAncestor< T > () |
| | Gets the nearest item of given type in the parent tree.
|
| |
| ProjectItem | GetChild (string childName) |
| | Gets the child item of the current item with the given name.
|
| |
| T | GetChild< T > (string childName) |
| | Gets the child item of the current item with the given name and type.
|
| |
| int | GetChildIndex (ProjectItem child) |
| |
| IEnumerable< Property > | GetContextProperties () |
| |
| IEnumerable< Property > | GetFixedProperties () |
| |
| IEnumerable< Property > | GetFrequentlyAddedProperties () |
| |
| ProjectItem | GetProjectItemByPath (string path) |
| |
| string | GetRelativeProjectPathTo (ProjectItem anotherItem) |
| |
| IEnumerable< Property > | GetRemovableProperties () |
| | Gets a list of properties which you can remove from an item.
|
| |
| BitmapSource | GetThumbnail (int width, int height, bool showChildren, bool showFullScreen, Node contextNode) |
| | Gets the thumbnail image for a project item.
|
| |
| BitmapSource | GetThumbnail (int width, int height, bool showChildren, bool showFullScreen, Node contextNode, float[] letterboxColorRGBA) |
| | Gets the thumbnail image for a project item.
|
| |
| IEnumerable< ProjectItem > | GetTreeItemsAsList () |
| | Enumerates the items under this ProjectItem including this item itself, children, and grand children.
|
| |
| bool | HasProperty (Property property) |
| | Checks whether an item has a specific property.
|
| |
| bool | HasProperty (string propertyName) |
| | Checks whether an item has a specific property.
|
| |
| bool | IsPropertyReadOnly (Property property) |
| |
| void | RegisterThumbnailUser (object user, uint width, uint height, bool showChildren, bool showFullScreen, Node contextNode) |
| | Registers a user for the thumbnail images for a project item.
|
| |
| void | RemoveProperty (Property property) |
| | Removes a property from an item.
|
| |
| void | RemoveProperty (string propertyName) |
| | Removes a property from an item.
|
| |
| void | SetChildIndex (ProjectItem child, int index) |
| |
| void | SetPropertyReadOnlyStatus (Property property, bool? value) |
| |
| void | UpdateValidity () |
| | Recalculates the validity the item.
|
| |
| object | Get (Property property) |
| | Gets the value of a property.
|
| |
| object | Get (string propertyName) |
| | Gets the value of a property.
|
| |
| T | Get< T > (TypedProperty< T > property) |
| | Gets the value of a property.
|
| |
| void | Set (string propertyName, object value) |
| | Sets the value of a property.
|
| |
| void | Set< T > (TypedProperty< T > property, T value) |
| | Sets the value of a property.
|
| |
| string | GenerateUniqueChildName (string defaultName) |
| | Generates a unique name.
|
| |
| string | GetInvalidityReasonOfNewName (string newName) |
| | Returns the reason why the passed name is not valid.
|
| |
Access nodes and resources in a Kanzi Studio project.
For example, use this class to get a node, add, remove, or set its properties, find out about its relations to other nodes, get notifications about changes to that node, and to delete the node.
◆ AddProperty() [1/2]
Adds a property to an item.
When you add a property to a node, the initial value of the property is the default value set for that property. Use the Set function to set the value of a property.
- Parameters
-
- See also
- AddProperty(string), RemoveProperty(Property), RemoveProperty(string)
Examples
To add a property to a node:
{
homePage.PropertyTypes.Node2DBackgroundBrush,
}
◆ AddProperty() [2/2]
Adds a property to an item.
When you add a property to a node, the initial value of the property is the default value set for that property. Use the Set function to set the value of a property.
- Parameters
-
| propertyName | The name of the property to add. |
- See also
- AddProperty(Property), RemoveProperty(string), RemoveProperty(Property)
Examples
To add a property to a node and set the value of the property:
To add a property to a node and set the value of the property to a resource:
{
homePage.AddProperty(
"Node2D.BackgroundBrush");
}
◆ BeginBatchModification()
◆ CanAddProperty() [1/2]
Checks whether Kanzi Studio allows you to add a specific property to an item.
- Parameters
-
- Returns
- True when you can add the property to the item, otherwise false.
- See also
- CanAddProperty(string), HasProperty(Property), HasProperty(string)
Examples
To check whether Kanzi Studio allows you to add a specific property to a node:
◆ CanAddProperty() [2/2]
Checks whether Kanzi Studio allows you to add a specific property to an item.
- Parameters
-
| propertyName | The name of the property. |
- Returns
- True when you can add the property to the item, otherwise false.
- See also
- CanAddProperty(Property), HasProperty(string), HasProperty(Property)
Examples
To check whether Kanzi Studio allows you to add a specific property to a node:
{
if (
rootPage.CanAddProperty(
"Node2D.BackgroundBrush"))
{
rootPage.AddProperty(
"Node2D.BackgroundBrush");
}
}
◆ CommitBatchModification()
| void CommitBatchModification |
( |
| ) |
|
◆ Delete()
Deletes a project item.
- Returns
- When it deletes the item successfully, true, otherwise false.
Examples
To delete a node from the node tree:
◆ DeregisterThumbnailUser()
Deregisters a registerd thumbnail user.
- Parameters
-
| user | The registered thumbnail user you want to deregister. |
- See also
- GetThumbnail(int, int, bool, bool, Node), RegisterThumbnailUser
◆ GetAddableProperties()
| IEnumerable< Property > GetAddableProperties |
( |
| ) |
|
Gets a list of properties which you can add to an item.
- Returns
- A list of properties as Property object types which you can add to an item.
- See also
- GetRemovableProperties, AddProperty(string), AddProperty(Property)
Examples
To get a list of properties which you can add to a node:
◆ GetAncestor< T >()
Gets the nearest item of given type in the parent tree.
The parent tree starts from the item itself, then this.Parent, then this.Parent.Parent, and so on.
- Template Parameters
-
◆ GetChild()
Gets the child item of the current item with the given name.
For example, use this function to get the child nodes of the current node, or items in any of the Kanzi Studio project libraries, such as Brushes, Textures, Styles, and so on.
- Parameters
-
| childName | The name of the child item you want to get with this function. |
- Returns
- The child item with matching name, or null if not found.
- See also
- Children
Examples
To get a node:
To get a resource:
◆ GetChild< T >()
Gets the child item of the current item with the given name and type.
For example, use this function to get the child nodes of the current node, or items in any of the Kanzi Studio project libraries, such as Brushes, Textures, Styles, and so on.
- Template Parameters
-
| T | The type of the item you want to get with this function. |
- Parameters
-
| childName | The name of the child item you want to get with this function. |
- Returns
- The child item with matching name and type, or null if not found.
- See also
- Children
Examples
To get a node:
To get a resource:
◆ GetChildIndex()
◆ GetContextProperties()
| IEnumerable< Property > GetContextProperties |
( |
| ) |
|
◆ GetFixedProperties()
| IEnumerable< Property > GetFixedProperties |
( |
| ) |
|
◆ GetFrequentlyAddedProperties()
| IEnumerable< Property > GetFrequentlyAddedProperties |
( |
| ) |
|
◆ GetProjectItemByPath()
◆ GetRelativeProjectPathTo()
◆ GetRemovableProperties()
| IEnumerable< Property > GetRemovableProperties |
( |
| ) |
|
Gets a list of properties which you can remove from an item.
- Returns
- A list of properties as Property object types which you can remove from an item.
- See also
- GetAddableProperties, RemoveProperty(string), RemoveProperty(Property)
Examples
To get a list of properties which you can remove from a node:
◆ GetThumbnail() [1/2]
Gets the thumbnail image for a project item.
If you use the RegisterThumbnailUser function, Kanzi makes the image availabe in cache for quick retrival, otherwise the rendering of the thumbnail takes more time.
- Parameters
-
| width | The width of the thumbnail image. |
| height | The height of the thumbnail image. |
| showChildren | If set to true [show children]. |
| showFullScreen | If set to true [show full screen]. |
| contextNode | The context node for resources, such as states, that require a node to display themselves in. |
- Returns
- The thumbnail image of the project item.
◆ GetThumbnail() [2/2]
Gets the thumbnail image for a project item.
If you use the RegisterThumbnailUser function, Kanzi makes the image availabe in cache for quick retrival, otherwise the rendering of the thumbnail takes more time.
- Parameters
-
| width | The width of the thumbnail image. |
| height | The height of the thumbnail image. |
| showChildren | If set to true [show children]. |
| showFullScreen | If set to true [show full screen]. |
| contextNode | The context node for resources, such as states, that require a node to display themselves in. |
| letterboxColorRGBA | Letter box color |
- Returns
- The thumbnail image of the project item.
◆ GetTreeItemsAsList()
Enumerates the items under this ProjectItem including this item itself, children, and grand children.
- Returns
◆ HasProperty() [1/2]
Checks whether an item has a specific property.
For example, use this function to check for the presence of a specific property before trying to add or remove that property from an item.
- Parameters
-
| property | The property the presence of which you want to check. |
- Returns
- True when the item has the specified property, otherwise false.
- See also
- AddProperty(string), AddProperty(Property), RemoveProperty(string), RemoveProperty(Property), CanAddProperty(string), CanAddProperty(Property)
Examples
To check whether a node has a specific property:
◆ HasProperty() [2/2]
Checks whether an item has a specific property.
For example, use this function to check for the presence of a specific property before trying to add or remove that property from an item.
- Parameters
-
| propertyName | The name of the property the presence of which you want to check. |
- Returns
- True when the item has the specified property, otherwise false.
- See also
- AddProperty(string), AddProperty(Property), RemoveProperty(string), RemoveProperty(Property), CanAddProperty(string), CanAddProperty(Property)
Examples
To check whether a node has a specific property:
{
{
rootPage.AddProperty(
"Node2D.BackgroundBrush");
}
}
◆ IsPropertyReadOnly()
◆ RegisterThumbnailUser()
Registers a user for the thumbnail images for a project item.
Registering allows you to retrieve thumbnail images in the background before Kanzi sets off the ThumbnailChanged event. After registering, the calls to the GetThumbnail retrieve the cached thumbnail image faster than if you do not register. You must deregister using the DeregisterThumbnailUser function when you are not using the thumbnail images anymore.
- Parameters
-
| user | The user. |
| width | The width of the thumbnail image. |
| height | The height of the thumbnail image. |
| showChildren | If set to true [show children]. |
| showFullScreen | If set to true [show full screen]. |
| contextNode | The context node for resources, such as states, that require a node to display themselves in. |
- See also
- GetThumbnail(int, int, bool, bool, Node), DeregisterThumbnailUser
◆ RemoveProperty() [1/2]
Removes a property from an item.
- Parameters
-
| property | The property to remove. |
- See also
- RemoveProperty(string), AddProperty(Property), AddProperty(string)
Examples
To remove a property from a node:
◆ RemoveProperty() [2/2]
Removes a property from an item.
- Parameters
-
| propertyName | The name of the property to remove. |
- See also
- RemoveProperty(Property), AddProperty(string), AddProperty(Property)
Examples
To remove a property from a node:
{
rootPage.RemoveProperty(
"Node2D.BackgroundBrush");
}
◆ SetChildIndex()
◆ SetPropertyReadOnlyStatus()
◆ UpdateValidity()
Recalculates the validity the item.
This can be called if there has happened an external change that affects the validity but has not triggered change in the item itself. This situation can arise e.g. when implementing EditTimeComponentPlugin that returns problem descriptions based on the state of other nodes than the current one.
◆ Children
Gets all child items of a project item.
- See also
- GetChild(string), GetChild<T>(string)
Examples
To get all child nodes of a node:
{
var rootPage =
studio.ActiveProject.GetProjectItem(
"Screens/Screen/RootPage").Children;
{
}
}
To get all resources from a library:
◆ IconLocation
◆ IconModifier
◆ InvalidityReason
◆ IsDeleted
◆ IsDisposed
◆ IsHidden
◆ IsReadOnly
◆ IsValidState
◆ KzbUrl
Gets the kzb URL of a project item.
The kzb URL gives you the exact location of a project item. For example, you can use the kzb URL to access a node or a resource in a JavaScript script in your Kanzi application.
Examples
To get the kzb URL of a node:
To get the kzb URL of a resource:
◆ Name
Gets or sets the name of a project item.
This is the same value as the value of the Name property. The name must be unique among children of the same parent.
Examples
To get the name of a node:
To get the name of a resource:
◆ Parent
◆ Path
◆ Project
Gets the project in which this item is located.
◆ ProjectItemType
◆ PropertyTypeLibrary
Gets the Property Types library of the project of this item which stores all property types you create in a Kanzi Studio project.
After you get the library, you can access and create resources in that library.
Examples
To get all property types in the Property Types library:
To create your own property type of the integer data type:
{
"My Int Property",
"My Properties",
0,
9000,
10);
}
◆ PropertyTypes
Implemented in AbstractComposer, AbstractEnginePluginContentType, AbstractMaterialType, AbstractMeshNode, AbstractTheme, AbstractThemeGroup, AndroidBuildConfigurationItem, AngleTrajectory, Animation, AnimationChildClip, AnimationClip, AnimationClipBase, ApplicationConfigurationItem, ApplicationConfigurationResourceFileDirectory, ArcTrajectory, Asset3DImportSourceDirectory, Asset3DSourceFile, BinaryShaderFormat, BitmapFontFile, BoxMeshNode, Brush, BrushType, Button2D, CameraNode, CircleTrajectory, CombineObjectSource, ComponentNode, ComponentNode2D, ComponentType, Composer, ContainsPropertyFilterObjectSource, CubeMapRenderTargetTexture, CubeMapTexture, DataObject, DataSource, DataSourceType, DerivedMaterialType, DockLayout2D, EllipseTrajectory, EmptyNode, EmptyNode2D, EnginePlugin, EnginePluginFile, FixedSortFilterObjectSource, FlowLayout2D, FontDirectory, FontFamily, FontFile, FragmentShader, GenericResourceFile, GenericResourceFileDirectory, GeometryShader, GridLayout2D, GridListBox2D, Guide, Image2D, ImageDirectory, ImageFile, ImportSourceFile, InstantiatorNode, KzbReferenceItem, KzbSource, LegacyRenderPass, LevelOfDetailNode, LightNode, LineTrajectory, LocalizationTable, Material, MaterialType, Mesh, MeshBase, MeshNode, MeshNodeMesh, MessageType, Morph, NinePatchImage2D, Node, Node2D, Node2DPrefabPlaceholder, Node2DPrefabTemplate, Node3D, Node3DPrefabPlaceholder, Node3DPrefabTemplate, NodeComponent, NodeComponentType, NodeEffect2D, NodeEffectPrefab2D, NodeEffectType2D, ObjectSource, ObjectTypeFilterObjectSource, ObservableFile, OutputMaterial, Page, PageHost, PageTransition, PageTransitionAnimation, PageTransitionCollection, PlaneMeshNode, PrefabTemplate, PrimitiveMeshNode, ProgressiveRenderingNode2D, Project, ProjectReferenceItem, PropertyIsEqualObjectSource, QNXBuildConfigurationItem, RectangleTrajectory, RenderPass, RenderPassPrefab, RenderPassType, RenderTargetTexture, ResourceDictionaryItem, ResourceFileDirectory, RootObjectSource, Scene, Screen, ScrollView2D, Shader, ShaderSourceDirectory, ShaderSourceFile, Shortcut, SingleInputObjectSource, SingleTexture, Slider2D, SourceAssetDirectory, SourceAssetFile, SphereMeshNode, SpiralTrajectory, SplineTrajectory, StackLayout2D, State, StateGroup, StateManager, StudioPluginItem, StyleItem, StyleLibrary, Tag, TagFilterObjectSource, TessellationControlShader, TessellationEvaluationShader, TextBlock2D, Texture, ThemeGroup, TimelineEntry, TimelineSequence, ToggleButton2D, ToggleButtonGroup2D, Trajectory, TrajectoryLayout2D, TrapezoidTrajectory, TriggerActionItem, TriggerActionType, TriggerConditionItem, TriggerNodeComponent, TrueTypeFontFile, VertexShader, Viewport2D, WindowsBuildConfigurationItem, and WriteLogActionForwardArgument.
◆ this[Property property]
◆ this[string propertyName]
◆ ToolTip
◆ TypeDisplayName
Gets the type of a project item.
Examples
To get the type of a node:
To get the type of a resource:
◆ ChildCollectionChanged
◆ Deleted
◆ Deleting
◆ DescendantChildCollectionChanged
◆ DescendantDeleted
◆ DescendantDynamicPropertyChanged
◆ DescendantParentChanged
◆ DescendantPropertyCollectionChanged
◆ Disposing
◆ DynamicPropertyChanged
◆ ParentChanged
◆ PathChanged
◆ PreviewDescendantDynamicPropertyChanged
◆ PreviewDynamicPropertyChanged
◆ PropertyCollectionChanged
◆ Replacing
◆ ThumbnailChanged
◆ ValidityChanged