Clone Method (SugarConnection)
Creates a new object that is a copy of the current instance.
This example shows how to clone a
SugarConnection. To make sure all the properties are inherited, one of them (UserId) is written to the console.
|
|---|
public void CloneAConnection()
{
SugarConnection sugarConnection = new SugarConnection(
"server=https://your_company.sugaropencloud.eu;user id=admin;password=AmFFA4ZryM;");
SugarConnection sugarConnection2 = (SugarConnection)sugarConnection.Clone();
Console.WriteLine(sugarConnection2.UserId);
} |
|
|---|
Public Sub CloneAConnection()
Dim sugarConnection As New SugarConnection( _
"server=https://your_company.sugaropencloud.eu;user id=admin;password=AmFFA4ZryM;")
Dim sugarConnection2 As SugarConnection = CType(sugarConnection.Clone(), SugarConnection)
Console.WriteLine(sugarConnection2.UserId)
End Sub |