Mercurial > silverbladetech
comparison SilverlightExampleApp/SilverlightExampleApp.Interfaces/Services/AuthenticationService.cs @ 59:3591c26bd63e
MVVMLight added
author | Steven Hollidge <stevenhollidge@hotmail.com> |
---|---|
date | Sat, 21 Apr 2012 19:20:28 +0100 |
parents | |
children |
comparison
equal
deleted
inserted
replaced
58:241e2f22ed3c | 59:3591c26bd63e |
---|---|
1 //------------------------------------------------------------------------------ | |
2 // <auto-generated> | |
3 // This code was generated by a tool. | |
4 // Runtime Version:4.0.30319.17379 | |
5 // | |
6 // Changes to this file may cause incorrect behavior and will be lost if | |
7 // the code is regenerated. | |
8 // </auto-generated> | |
9 //------------------------------------------------------------------------------ | |
10 | |
11 // | |
12 // This code was auto-generated by SlSvcUtil, version 5.0.61118.0 | |
13 // | |
14 | |
15 | |
16 [System.CodeDom.Compiler.GeneratedCodeAttribute("System.ServiceModel", "4.0.0.0")] | |
17 [System.ServiceModel.ServiceContractAttribute(Namespace="", ConfigurationName="AuthenticationService")] | |
18 public interface AuthenticationService | |
19 { | |
20 | |
21 [System.ServiceModel.OperationContractAttribute(AsyncPattern=true, Action="urn:AuthenticationService/Authenticate", ReplyAction="urn:AuthenticationService/AuthenticateResponse")] | |
22 System.IAsyncResult BeginAuthenticate(string username, string password, System.AsyncCallback callback, object asyncState); | |
23 | |
24 bool EndAuthenticate(System.IAsyncResult result); | |
25 | |
26 [System.ServiceModel.OperationContractAttribute(AsyncPattern=true, Action="urn:AuthenticationService/LogOut", ReplyAction="urn:AuthenticationService/LogOutResponse")] | |
27 System.IAsyncResult BeginLogOut(System.AsyncCallback callback, object asyncState); | |
28 | |
29 bool EndLogOut(System.IAsyncResult result); | |
30 } | |
31 | |
32 [System.CodeDom.Compiler.GeneratedCodeAttribute("System.ServiceModel", "4.0.0.0")] | |
33 public interface AuthenticationServiceChannel : AuthenticationService, System.ServiceModel.IClientChannel | |
34 { | |
35 } | |
36 | |
37 [System.Diagnostics.DebuggerStepThroughAttribute()] | |
38 [System.CodeDom.Compiler.GeneratedCodeAttribute("System.ServiceModel", "4.0.0.0")] | |
39 public partial class AuthenticateCompletedEventArgs : System.ComponentModel.AsyncCompletedEventArgs | |
40 { | |
41 | |
42 private object[] results; | |
43 | |
44 public AuthenticateCompletedEventArgs(object[] results, System.Exception exception, bool cancelled, object userState) : | |
45 base(exception, cancelled, userState) | |
46 { | |
47 this.results = results; | |
48 } | |
49 | |
50 public bool Result | |
51 { | |
52 get | |
53 { | |
54 base.RaiseExceptionIfNecessary(); | |
55 return ((bool)(this.results[0])); | |
56 } | |
57 } | |
58 } | |
59 | |
60 [System.Diagnostics.DebuggerStepThroughAttribute()] | |
61 [System.CodeDom.Compiler.GeneratedCodeAttribute("System.ServiceModel", "4.0.0.0")] | |
62 public partial class LogOutCompletedEventArgs : System.ComponentModel.AsyncCompletedEventArgs | |
63 { | |
64 | |
65 private object[] results; | |
66 | |
67 public LogOutCompletedEventArgs(object[] results, System.Exception exception, bool cancelled, object userState) : | |
68 base(exception, cancelled, userState) | |
69 { | |
70 this.results = results; | |
71 } | |
72 | |
73 public bool Result | |
74 { | |
75 get | |
76 { | |
77 base.RaiseExceptionIfNecessary(); | |
78 return ((bool)(this.results[0])); | |
79 } | |
80 } | |
81 } | |
82 | |
83 [System.Diagnostics.DebuggerStepThroughAttribute()] | |
84 [System.CodeDom.Compiler.GeneratedCodeAttribute("System.ServiceModel", "4.0.0.0")] | |
85 public partial class AuthenticationServiceClient : System.ServiceModel.ClientBase<AuthenticationService>, AuthenticationService | |
86 { | |
87 | |
88 private BeginOperationDelegate onBeginAuthenticateDelegate; | |
89 | |
90 private EndOperationDelegate onEndAuthenticateDelegate; | |
91 | |
92 private System.Threading.SendOrPostCallback onAuthenticateCompletedDelegate; | |
93 | |
94 private BeginOperationDelegate onBeginLogOutDelegate; | |
95 | |
96 private EndOperationDelegate onEndLogOutDelegate; | |
97 | |
98 private System.Threading.SendOrPostCallback onLogOutCompletedDelegate; | |
99 | |
100 private BeginOperationDelegate onBeginOpenDelegate; | |
101 | |
102 private EndOperationDelegate onEndOpenDelegate; | |
103 | |
104 private System.Threading.SendOrPostCallback onOpenCompletedDelegate; | |
105 | |
106 private BeginOperationDelegate onBeginCloseDelegate; | |
107 | |
108 private EndOperationDelegate onEndCloseDelegate; | |
109 | |
110 private System.Threading.SendOrPostCallback onCloseCompletedDelegate; | |
111 | |
112 public AuthenticationServiceClient() | |
113 { | |
114 } | |
115 | |
116 public AuthenticationServiceClient(string endpointConfigurationName) : | |
117 base(endpointConfigurationName) | |
118 { | |
119 } | |
120 | |
121 public AuthenticationServiceClient(string endpointConfigurationName, string remoteAddress) : | |
122 base(endpointConfigurationName, remoteAddress) | |
123 { | |
124 } | |
125 | |
126 public AuthenticationServiceClient(string endpointConfigurationName, System.ServiceModel.EndpointAddress remoteAddress) : | |
127 base(endpointConfigurationName, remoteAddress) | |
128 { | |
129 } | |
130 | |
131 public AuthenticationServiceClient(System.ServiceModel.Channels.Binding binding, System.ServiceModel.EndpointAddress remoteAddress) : | |
132 base(binding, remoteAddress) | |
133 { | |
134 } | |
135 | |
136 public System.Net.CookieContainer CookieContainer | |
137 { | |
138 get | |
139 { | |
140 System.ServiceModel.Channels.IHttpCookieContainerManager httpCookieContainerManager = this.InnerChannel.GetProperty<System.ServiceModel.Channels.IHttpCookieContainerManager>(); | |
141 if ((httpCookieContainerManager != null)) | |
142 { | |
143 return httpCookieContainerManager.CookieContainer; | |
144 } | |
145 else | |
146 { | |
147 return null; | |
148 } | |
149 } | |
150 set | |
151 { | |
152 System.ServiceModel.Channels.IHttpCookieContainerManager httpCookieContainerManager = this.InnerChannel.GetProperty<System.ServiceModel.Channels.IHttpCookieContainerManager>(); | |
153 if ((httpCookieContainerManager != null)) | |
154 { | |
155 httpCookieContainerManager.CookieContainer = value; | |
156 } | |
157 else | |
158 { | |
159 throw new System.InvalidOperationException("Unable to set the CookieContainer. Please make sure the binding contains an HttpC" + | |
160 "ookieContainerBindingElement."); | |
161 } | |
162 } | |
163 } | |
164 | |
165 public event System.EventHandler<AuthenticateCompletedEventArgs> AuthenticateCompleted; | |
166 | |
167 public event System.EventHandler<LogOutCompletedEventArgs> LogOutCompleted; | |
168 | |
169 public event System.EventHandler<System.ComponentModel.AsyncCompletedEventArgs> OpenCompleted; | |
170 | |
171 public event System.EventHandler<System.ComponentModel.AsyncCompletedEventArgs> CloseCompleted; | |
172 | |
173 [System.ComponentModel.EditorBrowsableAttribute(System.ComponentModel.EditorBrowsableState.Advanced)] | |
174 System.IAsyncResult AuthenticationService.BeginAuthenticate(string username, string password, System.AsyncCallback callback, object asyncState) | |
175 { | |
176 return base.Channel.BeginAuthenticate(username, password, callback, asyncState); | |
177 } | |
178 | |
179 [System.ComponentModel.EditorBrowsableAttribute(System.ComponentModel.EditorBrowsableState.Advanced)] | |
180 bool AuthenticationService.EndAuthenticate(System.IAsyncResult result) | |
181 { | |
182 return base.Channel.EndAuthenticate(result); | |
183 } | |
184 | |
185 private System.IAsyncResult OnBeginAuthenticate(object[] inValues, System.AsyncCallback callback, object asyncState) | |
186 { | |
187 string username = ((string)(inValues[0])); | |
188 string password = ((string)(inValues[1])); | |
189 return ((AuthenticationService)(this)).BeginAuthenticate(username, password, callback, asyncState); | |
190 } | |
191 | |
192 private object[] OnEndAuthenticate(System.IAsyncResult result) | |
193 { | |
194 bool retVal = ((AuthenticationService)(this)).EndAuthenticate(result); | |
195 return new object[] { | |
196 retVal}; | |
197 } | |
198 | |
199 private void OnAuthenticateCompleted(object state) | |
200 { | |
201 if ((this.AuthenticateCompleted != null)) | |
202 { | |
203 InvokeAsyncCompletedEventArgs e = ((InvokeAsyncCompletedEventArgs)(state)); | |
204 this.AuthenticateCompleted(this, new AuthenticateCompletedEventArgs(e.Results, e.Error, e.Cancelled, e.UserState)); | |
205 } | |
206 } | |
207 | |
208 public void AuthenticateAsync(string username, string password) | |
209 { | |
210 this.AuthenticateAsync(username, password, null); | |
211 } | |
212 | |
213 public void AuthenticateAsync(string username, string password, object userState) | |
214 { | |
215 if ((this.onBeginAuthenticateDelegate == null)) | |
216 { | |
217 this.onBeginAuthenticateDelegate = new BeginOperationDelegate(this.OnBeginAuthenticate); | |
218 } | |
219 if ((this.onEndAuthenticateDelegate == null)) | |
220 { | |
221 this.onEndAuthenticateDelegate = new EndOperationDelegate(this.OnEndAuthenticate); | |
222 } | |
223 if ((this.onAuthenticateCompletedDelegate == null)) | |
224 { | |
225 this.onAuthenticateCompletedDelegate = new System.Threading.SendOrPostCallback(this.OnAuthenticateCompleted); | |
226 } | |
227 base.InvokeAsync(this.onBeginAuthenticateDelegate, new object[] { | |
228 username, | |
229 password}, this.onEndAuthenticateDelegate, this.onAuthenticateCompletedDelegate, userState); | |
230 } | |
231 | |
232 [System.ComponentModel.EditorBrowsableAttribute(System.ComponentModel.EditorBrowsableState.Advanced)] | |
233 System.IAsyncResult AuthenticationService.BeginLogOut(System.AsyncCallback callback, object asyncState) | |
234 { | |
235 return base.Channel.BeginLogOut(callback, asyncState); | |
236 } | |
237 | |
238 [System.ComponentModel.EditorBrowsableAttribute(System.ComponentModel.EditorBrowsableState.Advanced)] | |
239 bool AuthenticationService.EndLogOut(System.IAsyncResult result) | |
240 { | |
241 return base.Channel.EndLogOut(result); | |
242 } | |
243 | |
244 private System.IAsyncResult OnBeginLogOut(object[] inValues, System.AsyncCallback callback, object asyncState) | |
245 { | |
246 return ((AuthenticationService)(this)).BeginLogOut(callback, asyncState); | |
247 } | |
248 | |
249 private object[] OnEndLogOut(System.IAsyncResult result) | |
250 { | |
251 bool retVal = ((AuthenticationService)(this)).EndLogOut(result); | |
252 return new object[] { | |
253 retVal}; | |
254 } | |
255 | |
256 private void OnLogOutCompleted(object state) | |
257 { | |
258 if ((this.LogOutCompleted != null)) | |
259 { | |
260 InvokeAsyncCompletedEventArgs e = ((InvokeAsyncCompletedEventArgs)(state)); | |
261 this.LogOutCompleted(this, new LogOutCompletedEventArgs(e.Results, e.Error, e.Cancelled, e.UserState)); | |
262 } | |
263 } | |
264 | |
265 public void LogOutAsync() | |
266 { | |
267 this.LogOutAsync(null); | |
268 } | |
269 | |
270 public void LogOutAsync(object userState) | |
271 { | |
272 if ((this.onBeginLogOutDelegate == null)) | |
273 { | |
274 this.onBeginLogOutDelegate = new BeginOperationDelegate(this.OnBeginLogOut); | |
275 } | |
276 if ((this.onEndLogOutDelegate == null)) | |
277 { | |
278 this.onEndLogOutDelegate = new EndOperationDelegate(this.OnEndLogOut); | |
279 } | |
280 if ((this.onLogOutCompletedDelegate == null)) | |
281 { | |
282 this.onLogOutCompletedDelegate = new System.Threading.SendOrPostCallback(this.OnLogOutCompleted); | |
283 } | |
284 base.InvokeAsync(this.onBeginLogOutDelegate, null, this.onEndLogOutDelegate, this.onLogOutCompletedDelegate, userState); | |
285 } | |
286 | |
287 private System.IAsyncResult OnBeginOpen(object[] inValues, System.AsyncCallback callback, object asyncState) | |
288 { | |
289 return ((System.ServiceModel.ICommunicationObject)(this)).BeginOpen(callback, asyncState); | |
290 } | |
291 | |
292 private object[] OnEndOpen(System.IAsyncResult result) | |
293 { | |
294 ((System.ServiceModel.ICommunicationObject)(this)).EndOpen(result); | |
295 return null; | |
296 } | |
297 | |
298 private void OnOpenCompleted(object state) | |
299 { | |
300 if ((this.OpenCompleted != null)) | |
301 { | |
302 InvokeAsyncCompletedEventArgs e = ((InvokeAsyncCompletedEventArgs)(state)); | |
303 this.OpenCompleted(this, new System.ComponentModel.AsyncCompletedEventArgs(e.Error, e.Cancelled, e.UserState)); | |
304 } | |
305 } | |
306 | |
307 public void OpenAsync() | |
308 { | |
309 this.OpenAsync(null); | |
310 } | |
311 | |
312 public void OpenAsync(object userState) | |
313 { | |
314 if ((this.onBeginOpenDelegate == null)) | |
315 { | |
316 this.onBeginOpenDelegate = new BeginOperationDelegate(this.OnBeginOpen); | |
317 } | |
318 if ((this.onEndOpenDelegate == null)) | |
319 { | |
320 this.onEndOpenDelegate = new EndOperationDelegate(this.OnEndOpen); | |
321 } | |
322 if ((this.onOpenCompletedDelegate == null)) | |
323 { | |
324 this.onOpenCompletedDelegate = new System.Threading.SendOrPostCallback(this.OnOpenCompleted); | |
325 } | |
326 base.InvokeAsync(this.onBeginOpenDelegate, null, this.onEndOpenDelegate, this.onOpenCompletedDelegate, userState); | |
327 } | |
328 | |
329 private System.IAsyncResult OnBeginClose(object[] inValues, System.AsyncCallback callback, object asyncState) | |
330 { | |
331 return ((System.ServiceModel.ICommunicationObject)(this)).BeginClose(callback, asyncState); | |
332 } | |
333 | |
334 private object[] OnEndClose(System.IAsyncResult result) | |
335 { | |
336 ((System.ServiceModel.ICommunicationObject)(this)).EndClose(result); | |
337 return null; | |
338 } | |
339 | |
340 private void OnCloseCompleted(object state) | |
341 { | |
342 if ((this.CloseCompleted != null)) | |
343 { | |
344 InvokeAsyncCompletedEventArgs e = ((InvokeAsyncCompletedEventArgs)(state)); | |
345 this.CloseCompleted(this, new System.ComponentModel.AsyncCompletedEventArgs(e.Error, e.Cancelled, e.UserState)); | |
346 } | |
347 } | |
348 | |
349 public void CloseAsync() | |
350 { | |
351 this.CloseAsync(null); | |
352 } | |
353 | |
354 public void CloseAsync(object userState) | |
355 { | |
356 if ((this.onBeginCloseDelegate == null)) | |
357 { | |
358 this.onBeginCloseDelegate = new BeginOperationDelegate(this.OnBeginClose); | |
359 } | |
360 if ((this.onEndCloseDelegate == null)) | |
361 { | |
362 this.onEndCloseDelegate = new EndOperationDelegate(this.OnEndClose); | |
363 } | |
364 if ((this.onCloseCompletedDelegate == null)) | |
365 { | |
366 this.onCloseCompletedDelegate = new System.Threading.SendOrPostCallback(this.OnCloseCompleted); | |
367 } | |
368 base.InvokeAsync(this.onBeginCloseDelegate, null, this.onEndCloseDelegate, this.onCloseCompletedDelegate, userState); | |
369 } | |
370 | |
371 protected override AuthenticationService CreateChannel() | |
372 { | |
373 return new AuthenticationServiceClientChannel(this); | |
374 } | |
375 | |
376 private class AuthenticationServiceClientChannel : ChannelBase<AuthenticationService>, AuthenticationService | |
377 { | |
378 | |
379 public AuthenticationServiceClientChannel(System.ServiceModel.ClientBase<AuthenticationService> client) : | |
380 base(client) | |
381 { | |
382 } | |
383 | |
384 public System.IAsyncResult BeginAuthenticate(string username, string password, System.AsyncCallback callback, object asyncState) | |
385 { | |
386 object[] _args = new object[2]; | |
387 _args[0] = username; | |
388 _args[1] = password; | |
389 System.IAsyncResult _result = base.BeginInvoke("Authenticate", _args, callback, asyncState); | |
390 return _result; | |
391 } | |
392 | |
393 public bool EndAuthenticate(System.IAsyncResult result) | |
394 { | |
395 object[] _args = new object[0]; | |
396 bool _result = ((bool)(base.EndInvoke("Authenticate", _args, result))); | |
397 return _result; | |
398 } | |
399 | |
400 public System.IAsyncResult BeginLogOut(System.AsyncCallback callback, object asyncState) | |
401 { | |
402 object[] _args = new object[0]; | |
403 System.IAsyncResult _result = base.BeginInvoke("LogOut", _args, callback, asyncState); | |
404 return _result; | |
405 } | |
406 | |
407 public bool EndLogOut(System.IAsyncResult result) | |
408 { | |
409 object[] _args = new object[0]; | |
410 bool _result = ((bool)(base.EndInvoke("LogOut", _args, result))); | |
411 return _result; | |
412 } | |
413 } | |
414 } |