public virtual TClient CreateCustomClient <TClient>(params object[] parameters) where TClient : ServiceClient <TClient>
        {
            List <Type> types = new List <Type>();

            foreach (object obj in parameters)
            {
                types.Add(obj.GetType());
            }

            var constructor = typeof(TClient).GetConstructor(types.ToArray());

            if (constructor == null)
            {
                throw new InvalidOperationException(string.Format(Resources.InvalidManagementClientType, typeof(TClient).Name));
            }

            TClient client = (TClient)constructor.Invoke(parameters);

            foreach (ProductInfoHeaderValue userAgent in _userAgents.Keys)
            {
                client.UserAgent.Add(userAgent);
            }

            foreach (DelegatingHandler handler in GetCustomHandlers())
            {
                client.AddHandlerToPipeline(handler);
            }

            client.AddHandlerToPipeline(DefaultCancelRetryHandler.Clone() as CancelRetryHandler);
            return(client);
        }