1 Connect Server

You can use Site.Connect function to connect to a server. This function has two versions of parameters. 

async public static Task Connect(Server serverObject)

async public static Task Connect(string siteName)

In addition to passing a Server object, you can also pass the site name which is the name of the server in the Site Manager Dialog.

For connecting the "demo" site you can use Site.Connect("demo") and for the "local" site use Site.Connect("Test/local").

2 Edit Site List

Use Site.Add to create a new site and Site.Remove to remove a site,  for more detail information about the Site class please refer to the 

Site API reference.