GoogleApi.Entities.Maps.Elevation.Request.ElevationRequest.GetQueryStringParameters C# (CSharp) Méthode

GetQueryStringParameters() protected méthode

Get the query string collection of added parameters for the request.
protected GetQueryStringParameters ( ) : QueryStringParametersList
Résultat GoogleApi.Helpers.QueryStringParametersList
        protected override QueryStringParametersList GetQueryStringParameters()
        {
            if (this.Locations == null == (this.Path == null))
                throw new ArgumentException("Either Locations or Path must be specified, and both cannot be specified.");

            var parameters = base.GetQueryStringParameters();

            if (this.Locations == null)
            {
                if (this.Samples == null)
                    throw new ArgumentException("Samples is required when using the Path.");

                parameters.Add("path", string.Join("|", this.Path ?? new[] { new Location(0, 0) }));
                parameters.Add("samples", this.Samples.ToString());
            }
            else
                parameters.Add("locations", string.Join("|", this.Locations));

            return parameters;
        }