-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathBingSearchContainer.cs
246 lines (216 loc) · 9.81 KB
/
BingSearchContainer.cs
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
//------------------------------------------------------------------------------
// <auto-generated>
// This code was generated by a tool.
// Runtime Version:4.0.30319.18051
//
// Changes to this file may cause incorrect behavior and will be lost if
// the code is regenerated.
// </auto-generated>
//------------------------------------------------------------------------------
// Notice: Use of the service proxies that accompany this notice is subject to
// the terms and conditions of the license agreement located at
// http://go.microsoft.com/fwlink/?LinkID=202740
// If you do not agree to these terms you may not use this content.
namespace Bing {
using System;
using System.Collections.Generic;
using System.Data.Services.Client;
using System.Net;
using System.IO;
public partial class ExpandableSearchResult {
private Guid _ID;
private Int64? _WebTotal;
private Int64? _WebOffset;
private String _AlteredQuery;
private String _AlterationOverrideQuery;
private System.Collections.ObjectModel.Collection<WebResult> _Web;
public Guid ID {
get {
return this._ID;
}
set {
this._ID = value;
}
}
public Int64? WebTotal {
get {
return this._WebTotal;
}
set {
this._WebTotal = value;
}
}
public Int64? WebOffset {
get {
return this._WebOffset;
}
set {
this._WebOffset = value;
}
}
public String AlteredQuery {
get {
return this._AlteredQuery;
}
set {
this._AlteredQuery = value;
}
}
public String AlterationOverrideQuery {
get {
return this._AlterationOverrideQuery;
}
set {
this._AlterationOverrideQuery = value;
}
}
public System.Collections.ObjectModel.Collection<WebResult> Web {
get {
return this._Web;
}
set {
this._Web = value;
}
}
}
public partial class WebResult {
private Guid _ID;
private String _Title;
private String _Description;
private String _DisplayUrl;
private String _Url;
public Guid ID {
get {
return this._ID;
}
set {
this._ID = value;
}
}
public String Title {
get {
return this._Title;
}
set {
this._Title = value;
}
}
public String Description {
get {
return this._Description;
}
set {
this._Description = value;
}
}
public String DisplayUrl {
get {
return this._DisplayUrl;
}
set {
this._DisplayUrl = value;
}
}
public String Url {
get {
return this._Url;
}
set {
this._Url = value;
}
}
}
public partial class BingSearchContainer : System.Data.Services.Client.DataServiceContext {
public BingSearchContainer(Uri serviceRoot) :
base(serviceRoot) {
}
/// <summary>
/// </summary>
/// <param name="Query">Bing search query Sample Values : xbox</param>
/// <param name="Market">Market. Note: Not all Sources support all markets. Sample Values : en-US</param>
/// <param name="Adult">Adult setting is used for filtering sexually explicit content Sample Values : Moderate</param>
/// <param name="Latitude">Latitude Sample Values : 47.603450</param>
/// <param name="Longitude">Longitude Sample Values : -122.329696</param>
/// <param name="WebFileType">File extensions to return Sample Values : XLS</param>
/// <param name="Options">Specifies options for this request for all Sources. Valid values are: DisableLocationDetection, EnableHighlighting. Sample Values : EnableHighlighting</param>
/// <param name="WebSearchOptions">Specify options for a request to the Web SourceType. Valid values are: DisableHostCollapsing, DisableQueryAlterations. Sample Values : DisableQueryAlterations</param>
public DataServiceQuery<WebResult> Web(String Query, String Market, String Adult, Double? Latitude, Double? Longitude, String WebFileType, String Options, String WebSearchOptions) {
if ((Query == null)) {
throw new System.ArgumentNullException("Query", "Query value cannot be null");
}
DataServiceQuery<WebResult> query;
query = base.CreateQuery<WebResult>("Web");
if ((Query != null)) {
query = query.AddQueryOption("Query", string.Concat("\'", System.Uri.EscapeDataString(Query), "\'"));
}
if ((Market != null)) {
query = query.AddQueryOption("Market", string.Concat("\'", System.Uri.EscapeDataString(Market), "\'"));
}
if ((Adult != null)) {
query = query.AddQueryOption("Adult", string.Concat("\'", System.Uri.EscapeDataString(Adult), "\'"));
}
if (((Latitude != null)
&& (Latitude.HasValue == true))) {
query = query.AddQueryOption("Latitude", Latitude.Value);
}
if (((Longitude != null)
&& (Longitude.HasValue == true))) {
query = query.AddQueryOption("Longitude", Longitude.Value);
}
if ((WebFileType != null)) {
query = query.AddQueryOption("WebFileType", string.Concat("\'", System.Uri.EscapeDataString(WebFileType), "\'"));
}
if ((Options != null)) {
query = query.AddQueryOption("Options", string.Concat("\'", System.Uri.EscapeDataString(Options), "\'"));
}
if ((WebSearchOptions != null)) {
query = query.AddQueryOption("WebSearchOptions", string.Concat("\'", System.Uri.EscapeDataString(WebSearchOptions), "\'"));
}
return query;
}
/// <summary>
/// </summary>
/// <param name="Query">Bing search query Sample Values : xbox</param>
/// <param name="Market">Market. Note: Not all Sources support all markets. Sample Values : en-US</param>
/// <param name="Adult">Adult setting is used for filtering sexually explicit content Sample Values : Moderate</param>
/// <param name="Latitude">Latitude Sample Values : 47.603450</param>
/// <param name="Longitude">Longitude Sample Values : -122.329696</param>
/// <param name="WebFileType">File extensions to return Sample Values : XLS</param>
/// <param name="Options">Specifies options for this request for all Sources. Valid values are: DisableLocationDetection, EnableHighlighting. Sample Values : EnableHighlighting</param>
/// <param name="WebSearchOptions">Specify options for a request to the Web SourceType. Valid values are: DisableHostCollapsing, DisableQueryAlterations. Sample Values : DisableQueryAlterations</param>
public DataServiceQuery<ExpandableSearchResult> Composite(String Query, String Market, String Adult, Double? Latitude, Double? Longitude, String WebFileType, String Options, String WebSearchOptions) {
if ((Query == null)) {
throw new System.ArgumentNullException("Query", "Query value cannot be null");
}
DataServiceQuery<ExpandableSearchResult> query;
query = base.CreateQuery<ExpandableSearchResult>("Composite");
if ((Query != null)) {
query = query.AddQueryOption("Query", string.Concat("\'", System.Uri.EscapeDataString(Query), "\'"));
}
if ((Market != null)) {
query = query.AddQueryOption("Market", string.Concat("\'", System.Uri.EscapeDataString(Market), "\'"));
}
if ((Adult != null)) {
query = query.AddQueryOption("Adult", string.Concat("\'", System.Uri.EscapeDataString(Adult), "\'"));
}
if (((Latitude != null)
&& (Latitude.HasValue == true))) {
query = query.AddQueryOption("Latitude", Latitude.Value);
}
if (((Longitude != null)
&& (Longitude.HasValue == true))) {
query = query.AddQueryOption("Longitude", Longitude.Value);
}
if ((WebFileType != null)) {
query = query.AddQueryOption("WebFileType", string.Concat("\'", System.Uri.EscapeDataString(WebFileType), "\'"));
}
if ((Options != null)) {
query = query.AddQueryOption("Options", string.Concat("\'", System.Uri.EscapeDataString(Options), "\'"));
}
if ((WebSearchOptions != null)) {
query = query.AddQueryOption("WebSearchOptions", string.Concat("\'", System.Uri.EscapeDataString(WebSearchOptions), "\'"));
}
return query;
}
}
}