public void Cleanup()
        {
            var servers        = _adminClient.GetServersAsync().WaitForResult();
            var pendingDeletes = new List <Task>();

            foreach (var server in servers.Servers)
            {
                if (Regex.IsMatch(server.Name, _serverPrefix))
                {
                    var deleteTask = _adminClient.DeleteServerAsync(server.ID);
                    pendingDeletes.Add(deleteTask);
                }
            }
            Task.WaitAll(pendingDeletes.ToArray());
        }
 private Task Cleanup()
 {
     return(Task.Run(async() =>
     {
         await _adminClient.DeleteServerAsync(_server.ID);
     }));
 }
 private Task Cleanup()
 {
     return(Task.Run(async() =>
     {
         try
         {
             var servers = await _adminClient.GetServersAsync();
             var pendingDeletes = new List <Task>();
             foreach (var server in servers.Servers)
             {
                 if (Regex.IsMatch(server.Name, _serverPrefix))
                 {
                     var deleteTask = _adminClient.DeleteServerAsync(server.ID);
                     pendingDeletes.Add(deleteTask);
                 }
             }
             Task.WaitAll(pendingDeletes.ToArray());
         }catch {}
     }));
 }