private void ConnectWorker_DoWork(object sender, DoWorkEventArgs passValue) { object[] argument = (object[])passValue.Argument; ServerConnect serverConnect = argument[0] as ServerConnect; SftpClient client = serverConnect.GetSftpClient; serverConnect.StartConnect(); m_ServerConnect.Add(serverConnect); if (SavesManager.GetSavesFolder(client).Count == 0) { SavesManager.CreatSavesFolder(client); } UI.SaveFolders_Cloud = SavesManager.GetSavesFolder(client); passValue.Result = new object[] { serverConnect }; }