Beispiel #1
0
        /// <summary>
        /// Sends a request to the map service provider.
        /// </summary>
        /// <since_tizen> 3 </since_tizen>
        /// <returns>Response from the map service provider.</returns>
        /// <privilege>http://tizen.org/privilege/mapservice</privilege>
        /// <privilege>http://tizen.org/privilege/internet</privilege>
        /// <privilege>http://tizen.org/privilege/network.get</privilege>
        /// <exception cref="System.NotSupportedException">Thrown when the required feature is not supported.</exception>
        /// <exception cref="System.UnauthorizedAccessException">Thrown when application does not have some privilege to access this method.</exception>
        /// <exception cref="System.InvalidOperationException">Thrown when the result is invalid.</exception>
        /// <exception cref="System.ArgumentException">Thrown when arguments are invalid.</exception>
        public async Task <IEnumerable <T> > GetResponseAsync()
        {
            IEnumerable <T> task = null;

            if (_requestTask == null || _requestTask.Task.IsCanceled)
            {
                _requestTask = new TaskCompletionSource <IEnumerable <T> >();
                startExecutionAction();
                task = await _requestTask.Task.ConfigureAwait(false);
            }
            errorCode.WarnIfFailed(errMessage);
            return(task);
        }