public OpenSearchRequest Create(QuerySettings querySettings, System.Collections.Specialized.NameValueCollection parameters) { UriBuilder builder = new UriBuilder("http://" + System.Environment.MachineName); string[] queryString = Array.ConvertAll(parameters.AllKeys, key => string.Format("{0}={1}", key, parameters[key])); builder.Query = string.Join("&", queryString); AtomOpenSearchRequest request = new AtomOpenSearchRequest(new OpenSearchUrl(builder.ToString()), GenerateSyndicationFeed); return(request); }
/// <summary> /// Create the specified querySettings and parameters. /// </summary> /// <param name="querySettings">Query settings.</param> /// <param name="parameters">Parameters.</param> public OpenSearchRequest Create(QuerySettings querySettings, NameValueCollection parameters) { UriBuilder url = new UriBuilder(context.BaseUrl); url.Path += "/data/collection/"; var array = (from key in parameters.AllKeys from value in parameters.GetValues(key) select string.Format("{0}={1}", HttpUtility.UrlEncode(key), HttpUtility.UrlEncode(value))) .ToArray(); url.Query = string.Join("&", array); AtomOpenSearchRequest request = new AtomOpenSearchRequest(new OpenSearchUrl(url.ToString()), GenerateCatalogueAtomFeed); return(request); }
public OpenSearchRequest Create(QuerySettings querySettings, NameValueCollection parameters) { UriBuilder url = new UriBuilder(context.BaseUrl); url.Path += "/" + this.Identifier; parameters.Add("t2-onewps", "true"); var array = (from key in parameters.AllKeys from value in parameters.GetValues(key) select string.Format("{0}={1}", HttpUtility.UrlEncode(key), HttpUtility.UrlEncode(value))) .ToArray(); url.Query = string.Join("&", array); var request = new AtomOpenSearchRequest(new OpenSearchUrl(url.Uri), OneWpsGenerateSyndicationFeed); return(request); }