Class ProjectsController
Implement the controller for the projects view and provide access to common project operations.
Inheritance
Inherited Members
Namespace: Sdl.TranslationStudioAutomation.IntegrationApi
Assembly: Sdl.TranslationStudioAutomation.IntegrationApi.dll
Syntax
[BindController("ProjectsView")]
public class ProjectsController : AbstractBindedController, IDisposable, IBindedController
Constructors
ProjectsController()
Declaration
public ProjectsController()
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 |
|---|---|
| System.Collections.Generic.IEnumerable<FileBasedProject> |
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 |
|---|---|---|
| System.Collections.Generic.IEnumerable<System.String> | projectsFilePaths | The physical paths to the project files. |
Returns
| Type | Description |
|---|---|
| System.Collections.Generic.IEnumerable<FileBasedProject> | 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 |
|---|---|---|
| System.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 |
|---|---|---|
| System.Collections.Generic.IEnumerable<FileBasedProject> | projects | Enumeration containg all the projects that should be closed. |
GetAllProjects()
Get all the projects
Declaration
public IEnumerable<FileBasedProject> GetAllProjects()
Returns
| Type | Description |
|---|---|
| System.Collections.Generic.IEnumerable<FileBasedProject> | An enumerable collection containing all the projects. |
GetProjectManagementService()
Declaration
protected virtual IProjectManagementService GetProjectManagementService()
Returns
| Type | Description |
|---|---|
| Sdl.TranslationStudio.Api.ProjectManagement.IProjectManagementService |
GetProjects()
Get the view visible projects
Declaration
public IEnumerable<FileBasedProject> GetProjects()
Returns
| Type | Description |
|---|---|
| System.Collections.Generic.IEnumerable<FileBasedProject> | An enumerable collection containing the visible projects |
GetProjectTemplates()
Gets all the available project templates.
Declaration
public IEnumerable<ProjectTemplateInfo> GetProjectTemplates()
Returns
| Type | Description |
|---|---|
| System.Collections.Generic.IEnumerable<ProjectTemplateInfo> | Anm enumerable collection containing all the project templates. |
GetProjectViewService()
Declaration
protected virtual IProjectsViewService GetProjectViewService()
Returns
| Type | Description |
|---|---|
| Sdl.TranslationStudio.Api.ProjectManagement.IProjectsViewService |
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 |
|---|---|
| System.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 |
|---|---|
| System.EventHandler<CurrentProjectCancelEventArgs> |
ProjectsChanged
Triggered when the list of visible projects is changed.
Declaration
public event EventHandler ProjectsChanged
Event Type
| Type | Description |
|---|---|
| System.EventHandler |
SelectedProjectsChanged
Triggered when the selected projects are changed.
Declaration
public event EventHandler SelectedProjectsChanged
Event Type
| Type | Description |
|---|---|
| System.EventHandler |