CasewareDocs

ServerProjectName

Using this property you can detect whether your IDEA instance is connected to an IDEA Server project.

Compatibility

Available as of IDEA version 10.1

Syntax

ServerProjectName

Example

public class TaskExecutionContext

.....

'Gets/sets the name of the active server project. It has the following format: "server_name\project_name"

public string ServerProjectName

This makes sense as Execution Context class already has the property "ProjectName".

Property "ServerProjectName" works as follows:

  1. By server-side execution, you will receive the following result "<server_name>\<active_project_name>;
  2. By local execution there are two possibilities:

    If the server is connected, the result is "<server_name>\<active_project_name>;

    Otherwise, the result is an empty string.

Here, <server_name> is the name of the current IDEA Task Management Server.

Sample script using the new property:

Sub Main 
Dim serverName As String
serverName = SmartContext.ServerProjectName
If serverName = "" Then

' Do something
Else

' Do something different
End If
End Sub