Access nodes and resources in a Kanzi Studio project. More...
Public Member Functions | |
void | AddProperty (string propertyName) |
Adds a property to an item. More... | |
void | AddProperty (Property property) |
Adds a property to an item. More... | |
void | BeginBatchModification (string batchName) |
bool | CanAddProperty (string propertyName) |
Checks whether Kanzi Studio allows you to add a specific property to an item. More... | |
bool | CanAddProperty (Property property) |
Checks whether Kanzi Studio allows you to add a specific property to an item. More... | |
void | CommitBatchModification () |
bool | Delete () |
Deletes a project item. More... | |
void | DeregisterThumbnailUser (object user) |
Deregisters a registerd thumbnail user. More... | |
IEnumerable< Property > | GetAddableProperties () |
Gets a list of properties which you can add to an item. More... | |
T | GetAncestor< T > () |
Gets the nearest item of given type in the parent tree. More... | |
ProjectItem | GetChild (string childName) |
Gets the child item of the current item with the given name. More... | |
T | GetChild< T > (string childName) |
Gets the child item of the current item with the given name and type. More... | |
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. More... | |
BitmapSource | GetThumbnail (int width, int height, bool showChildren, bool showFullScreen, Node contextNode) |
Gets the thumbnail image for a project item. More... | |
BitmapSource | GetThumbnail (int width, int height, bool showChildren, bool showFullScreen, Node contextNode, float[] letterboxColorRGBA) |
Gets the thumbnail image for a project item. More... | |
IEnumerable< ProjectItem > | GetTreeItemsAsList () |
Enumerates the items under this ProjectItem including this item itself, children, and grand children. More... | |
bool | HasProperty (string propertyName) |
Checks whether an item has a specific property. More... | |
bool | HasProperty (Property property) |
Checks whether an item has a specific property. More... | |
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. More... | |
void | RemoveProperty (string propertyName) |
Removes a property from an item. More... | |
void | RemoveProperty (Property property) |
Removes a property from an item. More... | |
void | SetChildIndex (ProjectItem child, int index) |
void | SetPropertyReadOnlyStatus (Property property, bool?value) |
void | UpdateValidity () |
Recalculates the validity the item. More... | |
Public Member Functions inherited from PropertyContainer | |
object | Get (string propertyName) |
Gets the value of a property. More... | |
object | Get (Property property) |
Gets the value of a property. More... | |
T | Get< T > (TypedProperty< T > property) |
Gets the value of a property. More... | |
void | Set (string propertyName, object value) |
Sets the value of a property. More... | |
void | Set< T > (TypedProperty< T > property, T value) |
Sets the value of a property. More... | |
Public Member Functions inherited from ChildContainer | |
string | GenerateUniqueChildName (string defaultName) |
Generates a unique name. More... | |
string | GetInvalidityReasonOfNewName (string newName) |
Returns the reason why the passed name is not valid. More... | |
Properties | |
IEnumerable< ProjectItem > | Children [get] |
Gets all child items of a project item. More... | |
string | HelpHeading [get] |
string | IconLocation [get] |
object | IconModifier [get, set] |
string | InvalidityReason [get] |
bool | IsDeleted [get] |
bool | IsDisposed [get] |
bool | IsHidden [get, set] |
bool | IsReadOnly [get, set] |
bool | IsValidState [get] |
string | KzbUrl [get] |
Gets the .kzb URL of a project item. More... | |
string | Name [get, set] |
Gets and sets the name of a project item. More... | |
ProjectItem | Parent [get, set] |
string | Path [get] |
Project | Project [get] |
Gets the project in which this item is located. More... | |
Type | ProjectItemType [get] |
PropertyTypeLibrary | PropertyTypeLibrary [get] |
Gets the Property Types library of the project of this item which stores all property types you create in a Kanzi Studio project. More... | |
object | this[Property property] [get, set] |
object | this[string propertyName] [get, set] |
string | ToolTip [get] |
string | TypeDisplayName [get] |
Gets the type of a project item. More... | |
Properties inherited from PropertyContainer | |
IEnumerable< Property > | Properties [get] |
Gets the properties in a project item or node component. More... | |
Events | |
EventHandler< CollectionChangedEventArgs< ProjectItem > > | ChildCollectionChanged |
EventHandler< DeletedEventArgs > | Deleted |
EventHandler< DeletedEventArgs > | Deleting |
EventHandler< CollectionChangedEventArgs< ProjectItem > > | DescendantChildCollectionChanged |
EventHandler< DeletedEventArgs > | DescendantDeleted |
EventHandler< DynamicPropertyChangedEventArgs > | DescendantDynamicPropertyChanged |
EventHandler< ParentChangedEventArgs > | DescendantParentChanged |
EventHandler< CollectionChangedEventArgs< string > > | DescendantPropertyCollectionChanged |
EventHandler< ProjectItemEventArgs > | Disposing |
EventHandler< DynamicPropertyChangedEventArgs > | DynamicPropertyChanged |
EventHandler< ParentChangedEventArgs > | ParentChanged |
EventHandler< PathChangedEventArgs > | PathChanged |
EventHandler< DynamicPropertyChangedEventArgs > | PreviewDescendantDynamicPropertyChanged |
EventHandler< DynamicPropertyChangedEventArgs > | PreviewDynamicPropertyChanged |
EventHandler< CollectionChangedEventArgs< string > > | PropertyCollectionChanged |
EventHandler< ReplaceEventArgs > | Replacing |
EventHandler | ThumbnailChanged |
EventHandler | ValidityChanged |
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.
void AddProperty | ( | string | propertyName | ) |
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.
propertyName | The name of the property to add. |
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:
void AddProperty | ( | Property | property | ) |
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.
property |
Examples
To add a property to a node:
bool CanAddProperty | ( | string | propertyName | ) |
Checks whether Kanzi Studio allows you to add a specific property to an item.
propertyName | The name of the property. |
Examples
To check whether Kanzi Studio allows you to add a specific property to a node:
bool CanAddProperty | ( | Property | property | ) |
Checks whether Kanzi Studio allows you to add a specific property to an item.
property | The property. |
Examples
To check whether Kanzi Studio allows you to add a specific property to a node:
bool Delete | ( | ) |
Deletes a project item.
Examples
To delete a node from the scene graph:
void DeregisterThumbnailUser | ( | object | user | ) |
Deregisters a registerd thumbnail user.
user | The registered thumbnail user you want to deregister. |
IEnumerable<Property> GetAddableProperties | ( | ) |
Gets a list of properties which you can add to an item.
Examples
To get a list of properties which you can add to a node:
T 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.
T | The type looked for |
T | : | class | |
T | : | ProjectItem |
ProjectItem GetChild | ( | string | childName | ) |
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.
childName | The name of the child item you want to get with this function. |
Examples
To get a node:
To get a resource:
T GetChild< T > | ( | string | childName | ) |
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.
T | The type of the item you want to get with this function. |
childName | The name of the child item you want to get with this function. |
Examples
To get a node:
To get a resource:
T | : | ProjectItem |
IEnumerable<Property> GetRemovableProperties | ( | ) |
Gets a list of properties which you can remove from an item.
Examples
To get a list of properties which you can remove from a node:
BitmapSource GetThumbnail | ( | int | width, |
int | height, | ||
bool | showChildren, | ||
bool | showFullScreen, | ||
Node | contextNode | ||
) |
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.
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. |
BitmapSource GetThumbnail | ( | int | width, |
int | height, | ||
bool | showChildren, | ||
bool | showFullScreen, | ||
Node | contextNode, | ||
float[] | letterboxColorRGBA | ||
) |
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.
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 |
IEnumerable<ProjectItem> GetTreeItemsAsList | ( | ) |
Enumerates the items under this ProjectItem including this item itself, children, and grand children.
bool HasProperty | ( | string | propertyName | ) |
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.
propertyName | The name of the property the presence of which you want to check. |
Examples
To check whether a node has a specific property:
bool HasProperty | ( | Property | property | ) |
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.
property | The property the presence of which you want to check. |
Examples
To check whether a node has a specific 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.
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.
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. |
void RemoveProperty | ( | string | propertyName | ) |
Removes a property from an item.
propertyName | The name of the property to remove. |
Examples
To remove a property from a node:
void RemoveProperty | ( | Property | property | ) |
Removes a property from an item.
property | The property to remove. |
Examples
To remove a property from a node:
void 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.
|
get |
Gets all child items of a project item.
The child items of the selected item.
Examples
To get all child nodes of a node:
To get all resources from a library:
|
get |
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.
The .kzb URL of the project item.
Examples
To get the .kzb URL of a node:
To get the .kzb URL of a resource:
|
getset |
Gets and 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.
The name of the project item.
Examples
To get the name of a node:
To get the name of a resource:
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.
The Property Types library in a Kanzi Studio project.
Examples
To create your own property type of the integer data type:
To get all property types in the Property Types library:
|
get |
Gets the type of a project item.
The type of the project item.
Examples
To get the type of a node:
To get the type of a resource: