TWSLink c# class library code snippet

using System;
using System.Collections.Generic;
using System.ComponentModel;
using System.Data;
using System.Drawing;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
using System.Windows.Forms;



namespace twslink2csapp
{
    
    public partial class Form1 : Form
    {
        private TWSLink2Wrap _twsl;

        public Form1()
        {
            InitializeComponent();
            test_connect();
        }
       
       
        #region test
        void    test_connect()
        {
            int ret=connect("",7496,0,2000);
        }
        #endregion

        #region twslink_instance
        private TWSLink2Wrap TL()
        // create a TWSLink COM instance
        {
            if (_twsl == null)
                _twsl = new TWSLink2Wrap("",1);
            return _twsl;
        }
        #endregion

        #region twslink_interface
        private int connect(string host,int port,int clientid,int timeout)
        {
            // connect to TWS or gateway;this will create a TWSLink instance and you can see the TWSLink tray icon in the taskbar
            int ret=TL().CONNECT(host,port,clientid,timeout);
            return ret;
        }
        #endregion

   
    }
}