Kanzi 3.9.10
Solution Interface Reference

Access the Kanzi Studio projects in a Kanzi solution. More...

Inheritance diagram for Solution:
[legend]
Collaboration diagram for Solution:
[legend]

Properties

Project ActiveProject [get, set]
 Gets or sets the currently selected project in Kanzi Studio.
 
Project PreviewStartupProject [get]
 Gets the project which the Preview currently shows.
 
Project PrimaryProject [get]
 Gets the project which the user opened in Kanzi Studio.
 
IEnumerable< ProjectProjects [get]
 Gets the Kanzi Studio projects in the Kanzi solution.
 

Detailed Description

Access the Kanzi Studio projects in a Kanzi solution.

Property Documentation

◆ ActiveProject

Project ActiveProject
getset

Gets or sets the currently selected project in Kanzi Studio.

Examples

To get the currently selected project in Kanzi Studio:

{
// Get the currently selected project in Kanzi Studio.
var activeProject = studio.ActiveProject;
// Print the name of the selected project to the Kanzi Studio Log window.
studio.Log(activeProject.Name);
}

◆ PreviewStartupProject

Project PreviewStartupProject
get

Gets the project which the Preview currently shows.

See also
KanziStudio.PreviewStarted

Examples

To get the project that the Preview window shows:

// Create the event handler and subscribe to the PreviewStarted event to get notified
// when the Kanzi Studio Preview starts.
{
// Create the event handler that is set off when the Preview starts.
studio.PreviewStarted += Studio_PreviewStarted;
}
private void Studio_PreviewStarted(object sender, EventArgs e)
{
// Get the project that the Preview window shows.
var previewProject = studio.Solution.PreviewStartupProject;
// When the Preview starts, print to the Kanzi Studio Log window
// "The Preview shows:" and the name of the project that the Preview shows.
studio.Log("The Preview shows: " + previewProject.Name);
}

To set the project that the Preview window shows:

// Set the project that the Preview window shows.
{
// If the Preview is running, stop the Preview.
if (studio.Commands.CanStopPreview())
{
studio.Commands.StopPreview();
}
// Start the Preview and show the main project of the solution in the Preview.
studio.Commands.StartPreview(studio.PrimaryProject);
}

◆ PrimaryProject

Project PrimaryProject
get

Gets the project which the user opened in Kanzi Studio.

Examples

To select the project which the user opened in Kanzi Studio:

{
// Get the project that the user opened in Kanzi Studio and select that project.
studio.Solution.ActiveProject = studio.PrimaryProject;
}

◆ Projects

IEnumerable<Project> Projects
get

Gets the Kanzi Studio projects in the Kanzi solution.

Examples

To get all projects in a Kanzi solution:

{
// Print the name of all projects in a Kanzi solution to the Kanzi Studio Log window.
studio.Log("This Kanzi solution contains these Kanzi Studio projects:");
foreach (var project in studio.Solution.Projects)
{
studio.Log(project.Name);
}
}