Repository.Project.GetCurrentProject: Difference between revisions

From ReliaWiki
Jump to navigation Jump to search
Line 7: Line 7:


== Usage Example ==
== Usage Example ==
{{Template:RepositoryFull.Ex}}
{{APIComment|'Declare a new repository connection class. See [[Repository Class|Repository]].}}
  Dim MyRepository As New Repository
 
{{APIComment|'Connect to a Synthesis repository.}}
  Dim Success As Boolean = False
  Success = MyRepository.ConnectToRepository("C:\Users\Name\Documents\ReliaSoft\Files\repository.rsr9")
 
{{APIComment|'Get a list of the names/IDs of projects in the connected repository.}}
  Dim ListOfProjects() As NameIdPair
  ListOfProjects = MyRepository.GetAllProjects()
 
{{APIComment|'Open the first project in the list.}}
  MyRepository.SetCurrentProject(ListOfProjects(0).ID)
 
{{APIComment|'Get the ID of the opened project.}}
  Dim ID As Integer
  ID = MyRepository.GetCurrentProject()
 
{{APIComment|'Disconnect from the repository.}}
  MyRepository.DisconnectFromRepository()

Revision as of 21:43, 27 May 2014


Returns the name and ID of the current project.

Syntax

Usage Example

 'Declare a new repository connection class. See Repository. 
 Dim MyRepository As New Repository
 
 'Connect to a Synthesis repository. 
 Dim Success As Boolean = False
 Success = MyRepository.ConnectToRepository("C:\Users\Name\Documents\ReliaSoft\Files\repository.rsr9")
 
 'Get a list of the names/IDs of projects in the connected repository. 
 Dim ListOfProjects() As NameIdPair
 ListOfProjects = MyRepository.GetAllProjects()
 
 'Open the first project in the list. 
 MyRepository.SetCurrentProject(ListOfProjects(0).ID)
 
 'Get the ID of the opened project. 
 Dim ID As Integer
 ID = MyRepository.GetCurrentProject()
 
 'Disconnect from the repository. 
 MyRepository.DisconnectFromRepository()