VersionControlServer.CreateWorkspace Method (String, String, String, array<WorkingFolder)
Creates a new workspace. The calling identity must have CreateWorkspace global permission. The computer attribute is the current machine. If you attempt to cloak a folder which is not actually mapped anywhere, an exception will occur: you can avoid this exception by using the overload method with fixMappingErrors.
Assembly: Microsoft.TeamFoundation.VersionControl.Client (in Microsoft.TeamFoundation.VersionControl.Client.dll)
'Declaration Public Function CreateWorkspace ( _ name As String, _ owner As String, _ comment As String, _ mappings As WorkingFolder() _ ) As Workspace
'Usage Dim instance As VersionControlServer Dim name As String Dim owner As String Dim comment As String Dim mappings As WorkingFolder() Dim returnValue As Workspace returnValue = instance.CreateWorkspace(name, _ owner, comment, mappings)
public Workspace CreateWorkspace( string name, string owner, string comment, WorkingFolder mappings )
public: Workspace^ CreateWorkspace( String^ name, String^ owner, String^ comment, array<WorkingFolder^>^ mappings )
public function CreateWorkspace( name : String, owner : String, comment : String, mappings : WorkingFolder ) : Workspace
The owner of this workspace. You must use the string constant RepositoryConstants.AuthenticatedUser or "." to default to the current user.
A descriptive comment that you want to use for the workspace.
An array of working folders that you want to establish for the workspace.
Each item in this array represents a server path ($/CmdLine) that you are either mapping to a local path (C:\code\CmdLine) or cloaking (in which case you do not specify any local path). Working folders are inherently recursive: if $/CmdLine maps to C:\code\CmdLine then $/CmdLine/shell will automatically map to C:\code\CmdLine\shell, so there is no need to specify that mapping explicitly.
Returns a reference to a Workspace object that represents the new workspace. If the workspace cannot be created, an exception occurs.
The calling identity must have the GlobalPermissionCreateWorkspace global permission. This method returns a reference to a workspace object. The computer attribute uses the current computer. An exception occurs if the workspace cannot be created.
.NET Framework Security
- Full trust for the immediate caller. This member cannot be used by partially trusted code. For more information, see Using Libraries from Partially Trusted Code.