Using the .NET API

The .NET API is separated into a set of classes. Keep the following in mind:

  • You need to add the sscmapi dll file as a reference to your .NET project in Visual Studio before using the API. The file is in the \API\lib directory in the Surround SCM application directory.
  • All timestamps received from the .NET API are in GMT. Make sure all timestamps sent to the API are also in GMT.

Key concepts

All calls use an SSCMContext class as the container that holds data for the currently connected session. The SetBranch() and SetMainline() methods are used by the other functions to identify the mainline and branch to perform operations against.

You typically begin using the API with a call to SSCMAPI.Connect, which establishes the initial context by taking an SSCMContext parameter as an out variable. You then set the context to the mainline and branch currently used. After all calls are complete, make a final call to SSCMAPI.Disconnect to close the session.

SSCMResult class

All calls also return an SSCMResult class. This result code indicates the status of the last call made and several methods are provided to view the returned error. You can use the SSCMAPI.GetLastError static method to return a string based on the error code and the error generated by the server. Only the server error string for the last error is stored by the library. The call string is cleared on the next successful function call.