ProjectManager
ProjectManager
项目相关
CreateProject(projectName)
返回值:Project
Creates and returns a project if projectName (text) is unique, and None if it is not.
DeleteProject(projectName)
返回值:Bool
Delete project in the current folder if not currently loaded
LoadProject(projectName)
返回值:Project
Loads and returns the project with name = projectName (text) if there is a match found, and None if there is no matching Project.
GetCurrentProject()
返回值:Project
Returns the currently loaded Resolve project.
SaveProject()
返回值:Bool
Saves the currently loaded project with its own name. Returns True if successful.
CloseProject(project)
返回值:Bool
Closes the specified project without saving.
文件夹相关
CreateFolder(folderName)
返回值:Bool
Creates a folder if folderName (text) is unique.
DeleteFolder(folderName)
返回值:Bool
Deletes the specified folder if it exists. Returns True in case of success.
GetProjectListInCurrentFolder()
返回值:[project names...]
Returns an array of project names in current folder.
注意
旧版本 GetProjectsInCurrentFolder()
已弃用
GetFolderListInCurrentFolder()
返回值:[folder names...]
Returns an array of folder names in current folder.
注意
旧版本 GetFoldersInCurrentFolder()
已弃用
GotoRootFolder()
返回值:Bool
Opens root folder in database.
GotoParentFolder()
返回值:Bool
Opens parent folder of current folder in database if current folder has parent.
GetCurrentFolder()
返回值:string
Returns the current folder name.
OpenFolder(folderName)
返回值:Bool
Opens folder under given name.
工程文件相关
ImportProject(filePath)
返回值:Bool
Imports a project under given file path. Returns true in case of success.
ExportProject(projectName, filePath)
返回值:Bool
Exports a project based on given name into provided file path. Returns true in case of success.
RestoreProject(filePath)
返回值:Bool
Restores a project under given backup file path. Returns true in case of success.
数据库相关
GetCurrentDatabase()
返回值: {dbInfo}
Returns a dictionary (with keys 'DbType', 'DbName' and optional 'IpAddress') corresponding to the current database connection
GetDatabaseList()
返回值: [{dbInfo}]
Returns a list of dictionary items (with keys 'DbType', 'DbName' and optional 'IpAddress') corresponding to all the databases added to Resolve
SetCurrentDatabase({dbInfo})
返回值: Bool
Switches current database connection to the database specified by the keys below, and closes any open project.
- 'DbType': 'Disk' or 'PostgreSQL' (string)
- 'DbName': database name (string)
- 'IpAddress': IP address of the PostgreSQL server (string, optional key - defaults to '127.0.0.1')