public IntPtr Connect(string deviceId, ConnectionParams parameters)
 {
     if (!this.connections.ContainsKey(deviceId))
     {
         try
         {
             this.BreakConnection(deviceId, 10 * 60 * 1000);
             IntPtr handle = ZKApi.Connect(parameters.ToString());
             connections.Add(deviceId, handle);
             return(handle);
         }
         catch (Exception ex)
         {
             return(IntPtr.Zero);
         }
     }
     return(connections[deviceId]);
 }