Beispiel #1
0
        /// <summary>
        /// Synchronously executes the "export map" operation and returns the response stream.
        /// </summary>
        /// <param name="parameters"></param>
        /// <returns>A <see cref="Stream"/>.  The type of data in the stream will depend on the <paramref name="parameters"/>.</returns>
        public Stream ExportMap(ExportMapParameters parameters)
        {
            var request  = CreateExportMapWebRequest(parameters);
            var response = request.GetResponse();
            var stream   = response.GetResponseStream();

            return(stream);
        }
Beispiel #2
0
        /// <summary>
        /// Creates an <see cref="HttpWebRequest"/> for the map service export map operation.
        /// </summary>
        /// <param name="parameters"></param>
        /// <returns></returns>
        public HttpWebRequest CreateExportMapWebRequest(ExportMapParameters parameters)
        {
            UriBuilder builder = new UriBuilder(string.Join("/", this.Uri, "export"));

            builder.Query = parameters.ToString();
            var request = (HttpWebRequest)HttpWebRequest.Create(builder.Uri);

            return(request);
        }
Beispiel #3
0
        /// <summary>
        /// Begins an asynchronous "Export Map" operation.
        /// </summary>
        /// <param name="parameters"></param>
        /// <returns>
        /// Returns an <see cref="IAsyncResult"/>.  The <see cref="IAsyncResult.AsyncState"/> value is an <see cref="ExportMapRequestState"/> object.
        /// </returns>
        public IAsyncResult BeginExportMap(ExportMapParameters parameters)
        {
            var request = CreateExportMapWebRequest(parameters);
            var state   = new ExportMapRequestState {
                Parameters = parameters,
                Request    = request
            };

            return(request.BeginGetResponse(OnExportMapComplete, state));
        }