Public Member Functions | Properties | List of all members
ProjectItemLibrary< out out T > Interface Template Reference

Access project libraries. More...

Inheritance diagram for ProjectItemLibrary< out out T >:
ProjectItem PropertyContainer ChildContainer

Public Member Functions

GetItemByName (string childName)
 Gets an item in a project library using the name of the item. More...
 
- Public Member Functions inherited from ProjectItem
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< PropertyGetAddableProperties ()
 Gets a list of properties which you can add to an item. More...
 
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...
 
GetChild< T > (string childName)
 Gets the child item of the current item with the given name and type. More...
 
int GetChildIndex (ProjectItem child)
 
IEnumerable< PropertyGetContextProperties ()
 
IEnumerable< PropertyGetFixedProperties ()
 
IEnumerable< PropertyGetFrequentlyAddedProperties ()
 
ProjectItem GetProjectItemByPath (string path)
 
string GetRelativeProjectPathTo (ProjectItem anotherItem)
 
IEnumerable< PropertyGetRemovableProperties ()
 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< ProjectItemGetTreeItemsAsList ()
 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...
 
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< T > Items [get]
 Gets all items in a specific project library of a Kanzi Studio project. More...
 
- Properties inherited from ProjectItem
IEnumerable< ProjectItemChildren [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< PropertyProperties [get]
 Gets the properties in a project item or node component. More...
 

Additional Inherited Members

- Events inherited from ProjectItem
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
 

Detailed Description

Access project libraries.

Template Parameters
T
Type Constraints
T :ProjectItem 

Member Function Documentation

T GetItemByName ( string  childName)

Gets an item in a project library using the name of the item.

Parameters
childNameThe name of the item.
Returns
The item.
See also
Project.CreateProjectItem<T>(string, ProjectItem), ChildContainer.GenerateUniqueChildName(string)

Examples

To get an item by name in a specific resource library:

public void Execute(PluginCommandParameter parameter)
{
// Get the State Managers library which stores state managers used in a Kanzi Studio project.
var stateManagerLibrary = studio.ActiveProject.StateManagerLibrary;
// Create a state manager named MyStateManager in the State Managers library.
studio.ActiveProject.CreateProjectItem<StateManager>(stateManagerLibrary.GenerateUniqueChildName("MyStateManager"), stateManagerLibrary);
// Get a state manager named MyStateManager from the State Managers library.
var myStateManager = stateManagerLibrary.GetItemByName("MyStateManager");
}

Property Documentation

IEnumerable<T> Items
get

Gets all items in a specific project library of a Kanzi Studio project.

See also
Project

Examples

To get all items in a specific resource library of a Kanzi Studio project:

public void Execute(PluginCommandParameter parameter)
{
// Get the Library > Materials and Textures > Material Types library
// which stores all the material types in a Kanzi Studio project.
var materialTypeLibrary = studio.ActiveProject.MaterialTypeLibrary;
// Print the name of all material types in your project to the Kanzi Studio Log window.
studio.Log("This Kanzi Studio project contains these material types:");
foreach (var materialType in materialTypeLibrary.Items)
{
studio.Log(materialType.Name);
}
}

To get the node component types available in a Kanzi Studio project:

public void Execute(PluginCommandParameter parameter)
{
// Get the node component type library.
var nodeComponentsLibrary = studio.ActiveProject.NodeComponentTypeLibrary;
// Print the available node component types to the Kanzi Studio Log window.
studio.Log("These node component types are available in this Kanzi Studio project:");
foreach (var nodeComponentType in nodeComponentsLibrary.Items)
{
studio.Log(nodeComponentType.Name);
}
}