private static Uri BuildMarketStatUri(IEnumerable<int> typeIds, int? hours, int? minQ, int[] regionLimit, int? useSystem)
        {
            UriBuilder uriBuilder = new UriBuilder("http://api.eve-central.com/api/marketstat");

            NameValueCollection nameValueCollection = new NameValueCollection();

            foreach (var typeId in typeIds)
                nameValueCollection.Add("typeid", typeId.ToString());

            if (hours.HasValue)
                nameValueCollection.Add("hours", hours.Value.ToString());

            if (minQ.HasValue)
                nameValueCollection.Add("minq", minQ.Value.ToString());

            if (regionLimit != null)
                foreach (var regionId in regionLimit)
                    nameValueCollection.Add("regionlimit", regionId.ToString());

            if (useSystem.HasValue)
                nameValueCollection.Add("usesystem", useSystem.Value.ToString());

            uriBuilder.BuildQuery(nameValueCollection);
            return uriBuilder.Uri;
        }