dotConnect for FreshBooks Documentation
Devart.Data.FreshBooks Namespace / FreshBooksConnection Class / Clone Method
Example

In This Topic
    Clone Method (FreshBooksConnection)
    In This Topic
    Creates a new object that is a copy of the current instance.
    Syntax
    'Declaration
     
    Public Function Clone() As FreshBooksConnection
    public FreshBooksConnection Clone()

    Return Value

    A new FreshBooksConnection object.
    Remarks

    Creates a new FreshBooksConnection object with the properties that have the same values as those of the original object. However, changing properties of the new object has no influence on the values of the same properties of the original object.

    Note that state of the new instance is always Closed, regardless of the state of original instance.

    Example
    This example shows how to clone a FreshBooksConnection. To make sure all the properties are inherited, one of them (UserId) is written to the console.
    public void CloneAConnection()
    {
      FreshBooksConnection freshbooksConnection = new FreshBooksConnection(
          "API Version=Alpha;Access Token=3d3355b2beea67f9241400fbe28f0b116e3efd2f8a85dda3c35620acdc95cd60;Refresh Token=75836f50da63fc5bf81bb24598511ae131ea422e73d9f321b4c4a44e2dd1c67f;Company Name=Devart");
      FreshBooksConnection freshbooksConnection2 = (FreshBooksConnection)freshbooksConnection.Clone();
      Console.WriteLine(freshbooksConnection2.UserId);
    }
    Public Sub CloneAConnection()
      Dim freshbooksConnection As New FreshBooksConnection( _
          "API Version=Alpha;Access Token=3d3355b2beea67f9241400fbe28f0b116e3efd2f8a85dda3c35620acdc95cd60;Refresh Token=75836f50da63fc5bf81bb24598511ae131ea422e73d9f321b4c4a44e2dd1c67f;Company Name=Devart")
      Dim freshbooksConnection2 As FreshBooksConnection = CType(freshbooksConnection.Clone(), FreshBooksConnection)
      Console.WriteLine(freshbooksConnection2.UserId)
    End Sub
    Requirements

    Target Platforms: Windows 7, Windows Vista SP1 or later, Windows XP SP3, Windows Server 2008 (Server Core not supported), Windows Server 2008 R2 (Server Core supported with SP1 or later), Windows Server 2003 SP2

    See Also