Class ProjectsController
Implement the controller for the projects view and provide access to common project operations.
Inheritance
Inherited Members
Namespace: SdlSdl.TranslationStudioAutomationIntegrationApi
Assembly: Sdl.TranslationStudioAutomation.IntegrationApi.dll
Syntax
[BindController("ProjectsView")]
public class ProjectsController : AbstractBindedController, IDisposable, IBindedController
Constructors
ProjectsController(IStudioWindow, IProjectManagementService, IProjectsViewService)
Declaration
public ProjectsController(IStudioWindow studioWindow, IProjectManagementService projectManagementService, IProjectsViewService projectsViewService)
Parameters
Type | Name | Description |
---|---|---|
Sdl.Desktop.Platform.IStudioWindow | studioWindow | |
Sdl.TranslationStudio.Api.ProjectManagement.IProjectManagementService | projectManagementService | |
Sdl.TranslationStudio.Api.ProjectManagement.IProjectsViewService | projectsViewService |
Properties
CurrentProject
Gets the current project.
Declaration
public FileBasedProject CurrentProject { get; }
Property Value
Type | Description |
---|---|
FileBasedProject |
SelectedProjects
Gets or sets the selected projects.
Declaration
public IEnumerable<FileBasedProject> SelectedProjects { get; set; }
Property Value
Type | Description |
---|---|
IEnumerableFileBasedProject |
Methods
ActivateProject(IProject)
Open and activate the specified project
Declaration
public void ActivateProject(IProject project)
Parameters
Type | Name | Description |
---|---|---|
IProject | project | The studio project to open and activate |
Add(IEnumerable<string>)
Add the projects for the specified files in the projects list
Declaration
public IEnumerable<FileBasedProject> Add(IEnumerable<string> projectsFilePaths)
Parameters
Type | Name | Description |
---|---|---|
IEnumerablestring | projectsFilePaths | The physical paths to the project files. |
Returns
Type | Description |
---|---|
IEnumerableFileBasedProject | An enumerable collection with the projects successfully opened. |
Remarks
It only opens the specified projects inside the projects view list.
Add(string)
Add the project for the specified file in the projects list
Declaration
public FileBasedProject Add(string projectFilePath)
Parameters
Type | Name | Description |
---|---|---|
string | projectFilePath | The physical paths to the project files. |
Returns
Type | Description |
---|---|
FileBasedProject | The project if successfully opened or null if the opening fails. |
Remarks
It only opens the specified projects inside the projects view list.
Close(FileBasedProject)
Close the specified project.
Declaration
public void Close(FileBasedProject project)
Parameters
Type | Name | Description |
---|---|---|
FileBasedProject | project | The project to be closed. |
Close(IEnumerable<FileBasedProject>)
Close all the specified projects.
Declaration
public void Close(IEnumerable<FileBasedProject> projects)
Parameters
Type | Name | Description |
---|---|---|
IEnumerableFileBasedProject | projects | Enumeration containg all the projects that should be closed. |
GetAllProjects()
Get all the projects
Declaration
public IEnumerable<FileBasedProject> GetAllProjects()
Returns
Type | Description |
---|---|
IEnumerableFileBasedProject | An enumerable collection containing all the projects. |
GetProjectTemplates()
Gets all the available project templates.
Declaration
public IEnumerable<ProjectTemplateInfo> GetProjectTemplates()
Returns
Type | Description |
---|---|
IEnumerableProjectTemplateInfo | Anm enumerable collection containing all the project templates. |
GetProjects()
Get the view visible projects
Declaration
public IEnumerable<FileBasedProject> GetProjects()
Returns
Type | Description |
---|---|
IEnumerableFileBasedProject | An enumerable collection containing the visible projects |
Initialize(IViewContext)
Initialize the project controller.
Declaration
protected override void Initialize(IViewContext context)
Parameters
Type | Name | Description |
---|---|---|
IViewContext | context | The context in which the project controller is initialized. |
Overrides
Open(FileBasedProject)
Open and activate the specified project
Declaration
public void Open(FileBasedProject project)
Parameters
Type | Name | Description |
---|---|---|
FileBasedProject | project | The studio project to open and activate |
RefreshProjects()
Refreshes the list of projects.
Declaration
public void RefreshProjects()
Events
CurrentProjectChanged
Triggered when the current project is changed.
Declaration
public event EventHandler CurrentProjectChanged
Event Type
Type | Description |
---|---|
EventHandler |
CurrentProjectChanging2
Triggered when current project is changing. CurrentProjectCancelEventArgs has a property with the new current project.
Declaration
public event EventHandler<CurrentProjectCancelEventArgs> CurrentProjectChanging2
Event Type
Type | Description |
---|---|
EventHandlerCurrentProjectCancelEventArgs |
ProjectsChanged
Triggered when the list of visible projects is changed.
Declaration
public event EventHandler ProjectsChanged
Event Type
Type | Description |
---|---|
EventHandler |
SelectedProjectsChanged
Triggered when the selected projects are changed.
Declaration
public event EventHandler SelectedProjectsChanged
Event Type
Type | Description |
---|---|
EventHandler |