annotate SilverlightExampleApp/SilverlightExampleApp.Interfaces/Services/SecureService.cs @ 59:3591c26bd63e

MVVMLight added
author Steven Hollidge <stevenhollidge@hotmail.com>
date Sat, 21 Apr 2012 19:20:28 +0100
parents
children
rev   line source
59
3591c26bd63e MVVMLight added
Steven Hollidge <stevenhollidge@hotmail.com>
parents:
diff changeset
1 //------------------------------------------------------------------------------
3591c26bd63e MVVMLight added
Steven Hollidge <stevenhollidge@hotmail.com>
parents:
diff changeset
2 // <auto-generated>
3591c26bd63e MVVMLight added
Steven Hollidge <stevenhollidge@hotmail.com>
parents:
diff changeset
3 // This code was generated by a tool.
3591c26bd63e MVVMLight added
Steven Hollidge <stevenhollidge@hotmail.com>
parents:
diff changeset
4 // Runtime Version:4.0.30319.17379
3591c26bd63e MVVMLight added
Steven Hollidge <stevenhollidge@hotmail.com>
parents:
diff changeset
5 //
3591c26bd63e MVVMLight added
Steven Hollidge <stevenhollidge@hotmail.com>
parents:
diff changeset
6 // Changes to this file may cause incorrect behavior and will be lost if
3591c26bd63e MVVMLight added
Steven Hollidge <stevenhollidge@hotmail.com>
parents:
diff changeset
7 // the code is regenerated.
3591c26bd63e MVVMLight added
Steven Hollidge <stevenhollidge@hotmail.com>
parents:
diff changeset
8 // </auto-generated>
3591c26bd63e MVVMLight added
Steven Hollidge <stevenhollidge@hotmail.com>
parents:
diff changeset
9 //------------------------------------------------------------------------------
3591c26bd63e MVVMLight added
Steven Hollidge <stevenhollidge@hotmail.com>
parents:
diff changeset
10
3591c26bd63e MVVMLight added
Steven Hollidge <stevenhollidge@hotmail.com>
parents:
diff changeset
11 //
3591c26bd63e MVVMLight added
Steven Hollidge <stevenhollidge@hotmail.com>
parents:
diff changeset
12 // This code was auto-generated by SlSvcUtil, version 5.0.61118.0
3591c26bd63e MVVMLight added
Steven Hollidge <stevenhollidge@hotmail.com>
parents:
diff changeset
13 //
3591c26bd63e MVVMLight added
Steven Hollidge <stevenhollidge@hotmail.com>
parents:
diff changeset
14
3591c26bd63e MVVMLight added
Steven Hollidge <stevenhollidge@hotmail.com>
parents:
diff changeset
15
3591c26bd63e MVVMLight added
Steven Hollidge <stevenhollidge@hotmail.com>
parents:
diff changeset
16 [System.CodeDom.Compiler.GeneratedCodeAttribute("System.ServiceModel", "4.0.0.0")]
3591c26bd63e MVVMLight added
Steven Hollidge <stevenhollidge@hotmail.com>
parents:
diff changeset
17 [System.ServiceModel.ServiceContractAttribute(Namespace="", ConfigurationName="SecureService")]
3591c26bd63e MVVMLight added
Steven Hollidge <stevenhollidge@hotmail.com>
parents:
diff changeset
18 public interface SecureService
3591c26bd63e MVVMLight added
Steven Hollidge <stevenhollidge@hotmail.com>
parents:
diff changeset
19 {
3591c26bd63e MVVMLight added
Steven Hollidge <stevenhollidge@hotmail.com>
parents:
diff changeset
20
3591c26bd63e MVVMLight added
Steven Hollidge <stevenhollidge@hotmail.com>
parents:
diff changeset
21 [System.ServiceModel.OperationContractAttribute(AsyncPattern=true, Action="urn:SecureService/DoWork", ReplyAction="urn:SecureService/DoWorkResponse")]
3591c26bd63e MVVMLight added
Steven Hollidge <stevenhollidge@hotmail.com>
parents:
diff changeset
22 System.IAsyncResult BeginDoWork(System.AsyncCallback callback, object asyncState);
3591c26bd63e MVVMLight added
Steven Hollidge <stevenhollidge@hotmail.com>
parents:
diff changeset
23
3591c26bd63e MVVMLight added
Steven Hollidge <stevenhollidge@hotmail.com>
parents:
diff changeset
24 void EndDoWork(System.IAsyncResult result);
3591c26bd63e MVVMLight added
Steven Hollidge <stevenhollidge@hotmail.com>
parents:
diff changeset
25 }
3591c26bd63e MVVMLight added
Steven Hollidge <stevenhollidge@hotmail.com>
parents:
diff changeset
26
3591c26bd63e MVVMLight added
Steven Hollidge <stevenhollidge@hotmail.com>
parents:
diff changeset
27 [System.CodeDom.Compiler.GeneratedCodeAttribute("System.ServiceModel", "4.0.0.0")]
3591c26bd63e MVVMLight added
Steven Hollidge <stevenhollidge@hotmail.com>
parents:
diff changeset
28 public interface SecureServiceChannel : SecureService, System.ServiceModel.IClientChannel
3591c26bd63e MVVMLight added
Steven Hollidge <stevenhollidge@hotmail.com>
parents:
diff changeset
29 {
3591c26bd63e MVVMLight added
Steven Hollidge <stevenhollidge@hotmail.com>
parents:
diff changeset
30 }
3591c26bd63e MVVMLight added
Steven Hollidge <stevenhollidge@hotmail.com>
parents:
diff changeset
31
3591c26bd63e MVVMLight added
Steven Hollidge <stevenhollidge@hotmail.com>
parents:
diff changeset
32 [System.Diagnostics.DebuggerStepThroughAttribute()]
3591c26bd63e MVVMLight added
Steven Hollidge <stevenhollidge@hotmail.com>
parents:
diff changeset
33 [System.CodeDom.Compiler.GeneratedCodeAttribute("System.ServiceModel", "4.0.0.0")]
3591c26bd63e MVVMLight added
Steven Hollidge <stevenhollidge@hotmail.com>
parents:
diff changeset
34 public partial class SecureServiceClient : System.ServiceModel.ClientBase<SecureService>, SecureService
3591c26bd63e MVVMLight added
Steven Hollidge <stevenhollidge@hotmail.com>
parents:
diff changeset
35 {
3591c26bd63e MVVMLight added
Steven Hollidge <stevenhollidge@hotmail.com>
parents:
diff changeset
36
3591c26bd63e MVVMLight added
Steven Hollidge <stevenhollidge@hotmail.com>
parents:
diff changeset
37 private BeginOperationDelegate onBeginDoWorkDelegate;
3591c26bd63e MVVMLight added
Steven Hollidge <stevenhollidge@hotmail.com>
parents:
diff changeset
38
3591c26bd63e MVVMLight added
Steven Hollidge <stevenhollidge@hotmail.com>
parents:
diff changeset
39 private EndOperationDelegate onEndDoWorkDelegate;
3591c26bd63e MVVMLight added
Steven Hollidge <stevenhollidge@hotmail.com>
parents:
diff changeset
40
3591c26bd63e MVVMLight added
Steven Hollidge <stevenhollidge@hotmail.com>
parents:
diff changeset
41 private System.Threading.SendOrPostCallback onDoWorkCompletedDelegate;
3591c26bd63e MVVMLight added
Steven Hollidge <stevenhollidge@hotmail.com>
parents:
diff changeset
42
3591c26bd63e MVVMLight added
Steven Hollidge <stevenhollidge@hotmail.com>
parents:
diff changeset
43 private BeginOperationDelegate onBeginOpenDelegate;
3591c26bd63e MVVMLight added
Steven Hollidge <stevenhollidge@hotmail.com>
parents:
diff changeset
44
3591c26bd63e MVVMLight added
Steven Hollidge <stevenhollidge@hotmail.com>
parents:
diff changeset
45 private EndOperationDelegate onEndOpenDelegate;
3591c26bd63e MVVMLight added
Steven Hollidge <stevenhollidge@hotmail.com>
parents:
diff changeset
46
3591c26bd63e MVVMLight added
Steven Hollidge <stevenhollidge@hotmail.com>
parents:
diff changeset
47 private System.Threading.SendOrPostCallback onOpenCompletedDelegate;
3591c26bd63e MVVMLight added
Steven Hollidge <stevenhollidge@hotmail.com>
parents:
diff changeset
48
3591c26bd63e MVVMLight added
Steven Hollidge <stevenhollidge@hotmail.com>
parents:
diff changeset
49 private BeginOperationDelegate onBeginCloseDelegate;
3591c26bd63e MVVMLight added
Steven Hollidge <stevenhollidge@hotmail.com>
parents:
diff changeset
50
3591c26bd63e MVVMLight added
Steven Hollidge <stevenhollidge@hotmail.com>
parents:
diff changeset
51 private EndOperationDelegate onEndCloseDelegate;
3591c26bd63e MVVMLight added
Steven Hollidge <stevenhollidge@hotmail.com>
parents:
diff changeset
52
3591c26bd63e MVVMLight added
Steven Hollidge <stevenhollidge@hotmail.com>
parents:
diff changeset
53 private System.Threading.SendOrPostCallback onCloseCompletedDelegate;
3591c26bd63e MVVMLight added
Steven Hollidge <stevenhollidge@hotmail.com>
parents:
diff changeset
54
3591c26bd63e MVVMLight added
Steven Hollidge <stevenhollidge@hotmail.com>
parents:
diff changeset
55 public SecureServiceClient()
3591c26bd63e MVVMLight added
Steven Hollidge <stevenhollidge@hotmail.com>
parents:
diff changeset
56 {
3591c26bd63e MVVMLight added
Steven Hollidge <stevenhollidge@hotmail.com>
parents:
diff changeset
57 }
3591c26bd63e MVVMLight added
Steven Hollidge <stevenhollidge@hotmail.com>
parents:
diff changeset
58
3591c26bd63e MVVMLight added
Steven Hollidge <stevenhollidge@hotmail.com>
parents:
diff changeset
59 public SecureServiceClient(string endpointConfigurationName) :
3591c26bd63e MVVMLight added
Steven Hollidge <stevenhollidge@hotmail.com>
parents:
diff changeset
60 base(endpointConfigurationName)
3591c26bd63e MVVMLight added
Steven Hollidge <stevenhollidge@hotmail.com>
parents:
diff changeset
61 {
3591c26bd63e MVVMLight added
Steven Hollidge <stevenhollidge@hotmail.com>
parents:
diff changeset
62 }
3591c26bd63e MVVMLight added
Steven Hollidge <stevenhollidge@hotmail.com>
parents:
diff changeset
63
3591c26bd63e MVVMLight added
Steven Hollidge <stevenhollidge@hotmail.com>
parents:
diff changeset
64 public SecureServiceClient(string endpointConfigurationName, string remoteAddress) :
3591c26bd63e MVVMLight added
Steven Hollidge <stevenhollidge@hotmail.com>
parents:
diff changeset
65 base(endpointConfigurationName, remoteAddress)
3591c26bd63e MVVMLight added
Steven Hollidge <stevenhollidge@hotmail.com>
parents:
diff changeset
66 {
3591c26bd63e MVVMLight added
Steven Hollidge <stevenhollidge@hotmail.com>
parents:
diff changeset
67 }
3591c26bd63e MVVMLight added
Steven Hollidge <stevenhollidge@hotmail.com>
parents:
diff changeset
68
3591c26bd63e MVVMLight added
Steven Hollidge <stevenhollidge@hotmail.com>
parents:
diff changeset
69 public SecureServiceClient(string endpointConfigurationName, System.ServiceModel.EndpointAddress remoteAddress) :
3591c26bd63e MVVMLight added
Steven Hollidge <stevenhollidge@hotmail.com>
parents:
diff changeset
70 base(endpointConfigurationName, remoteAddress)
3591c26bd63e MVVMLight added
Steven Hollidge <stevenhollidge@hotmail.com>
parents:
diff changeset
71 {
3591c26bd63e MVVMLight added
Steven Hollidge <stevenhollidge@hotmail.com>
parents:
diff changeset
72 }
3591c26bd63e MVVMLight added
Steven Hollidge <stevenhollidge@hotmail.com>
parents:
diff changeset
73
3591c26bd63e MVVMLight added
Steven Hollidge <stevenhollidge@hotmail.com>
parents:
diff changeset
74 public SecureServiceClient(System.ServiceModel.Channels.Binding binding, System.ServiceModel.EndpointAddress remoteAddress) :
3591c26bd63e MVVMLight added
Steven Hollidge <stevenhollidge@hotmail.com>
parents:
diff changeset
75 base(binding, remoteAddress)
3591c26bd63e MVVMLight added
Steven Hollidge <stevenhollidge@hotmail.com>
parents:
diff changeset
76 {
3591c26bd63e MVVMLight added
Steven Hollidge <stevenhollidge@hotmail.com>
parents:
diff changeset
77 }
3591c26bd63e MVVMLight added
Steven Hollidge <stevenhollidge@hotmail.com>
parents:
diff changeset
78
3591c26bd63e MVVMLight added
Steven Hollidge <stevenhollidge@hotmail.com>
parents:
diff changeset
79 public System.Net.CookieContainer CookieContainer
3591c26bd63e MVVMLight added
Steven Hollidge <stevenhollidge@hotmail.com>
parents:
diff changeset
80 {
3591c26bd63e MVVMLight added
Steven Hollidge <stevenhollidge@hotmail.com>
parents:
diff changeset
81 get
3591c26bd63e MVVMLight added
Steven Hollidge <stevenhollidge@hotmail.com>
parents:
diff changeset
82 {
3591c26bd63e MVVMLight added
Steven Hollidge <stevenhollidge@hotmail.com>
parents:
diff changeset
83 System.ServiceModel.Channels.IHttpCookieContainerManager httpCookieContainerManager = this.InnerChannel.GetProperty<System.ServiceModel.Channels.IHttpCookieContainerManager>();
3591c26bd63e MVVMLight added
Steven Hollidge <stevenhollidge@hotmail.com>
parents:
diff changeset
84 if ((httpCookieContainerManager != null))
3591c26bd63e MVVMLight added
Steven Hollidge <stevenhollidge@hotmail.com>
parents:
diff changeset
85 {
3591c26bd63e MVVMLight added
Steven Hollidge <stevenhollidge@hotmail.com>
parents:
diff changeset
86 return httpCookieContainerManager.CookieContainer;
3591c26bd63e MVVMLight added
Steven Hollidge <stevenhollidge@hotmail.com>
parents:
diff changeset
87 }
3591c26bd63e MVVMLight added
Steven Hollidge <stevenhollidge@hotmail.com>
parents:
diff changeset
88 else
3591c26bd63e MVVMLight added
Steven Hollidge <stevenhollidge@hotmail.com>
parents:
diff changeset
89 {
3591c26bd63e MVVMLight added
Steven Hollidge <stevenhollidge@hotmail.com>
parents:
diff changeset
90 return null;
3591c26bd63e MVVMLight added
Steven Hollidge <stevenhollidge@hotmail.com>
parents:
diff changeset
91 }
3591c26bd63e MVVMLight added
Steven Hollidge <stevenhollidge@hotmail.com>
parents:
diff changeset
92 }
3591c26bd63e MVVMLight added
Steven Hollidge <stevenhollidge@hotmail.com>
parents:
diff changeset
93 set
3591c26bd63e MVVMLight added
Steven Hollidge <stevenhollidge@hotmail.com>
parents:
diff changeset
94 {
3591c26bd63e MVVMLight added
Steven Hollidge <stevenhollidge@hotmail.com>
parents:
diff changeset
95 System.ServiceModel.Channels.IHttpCookieContainerManager httpCookieContainerManager = this.InnerChannel.GetProperty<System.ServiceModel.Channels.IHttpCookieContainerManager>();
3591c26bd63e MVVMLight added
Steven Hollidge <stevenhollidge@hotmail.com>
parents:
diff changeset
96 if ((httpCookieContainerManager != null))
3591c26bd63e MVVMLight added
Steven Hollidge <stevenhollidge@hotmail.com>
parents:
diff changeset
97 {
3591c26bd63e MVVMLight added
Steven Hollidge <stevenhollidge@hotmail.com>
parents:
diff changeset
98 httpCookieContainerManager.CookieContainer = value;
3591c26bd63e MVVMLight added
Steven Hollidge <stevenhollidge@hotmail.com>
parents:
diff changeset
99 }
3591c26bd63e MVVMLight added
Steven Hollidge <stevenhollidge@hotmail.com>
parents:
diff changeset
100 else
3591c26bd63e MVVMLight added
Steven Hollidge <stevenhollidge@hotmail.com>
parents:
diff changeset
101 {
3591c26bd63e MVVMLight added
Steven Hollidge <stevenhollidge@hotmail.com>
parents:
diff changeset
102 throw new System.InvalidOperationException("Unable to set the CookieContainer. Please make sure the binding contains an HttpC" +
3591c26bd63e MVVMLight added
Steven Hollidge <stevenhollidge@hotmail.com>
parents:
diff changeset
103 "ookieContainerBindingElement.");
3591c26bd63e MVVMLight added
Steven Hollidge <stevenhollidge@hotmail.com>
parents:
diff changeset
104 }
3591c26bd63e MVVMLight added
Steven Hollidge <stevenhollidge@hotmail.com>
parents:
diff changeset
105 }
3591c26bd63e MVVMLight added
Steven Hollidge <stevenhollidge@hotmail.com>
parents:
diff changeset
106 }
3591c26bd63e MVVMLight added
Steven Hollidge <stevenhollidge@hotmail.com>
parents:
diff changeset
107
3591c26bd63e MVVMLight added
Steven Hollidge <stevenhollidge@hotmail.com>
parents:
diff changeset
108 public event System.EventHandler<System.ComponentModel.AsyncCompletedEventArgs> DoWorkCompleted;
3591c26bd63e MVVMLight added
Steven Hollidge <stevenhollidge@hotmail.com>
parents:
diff changeset
109
3591c26bd63e MVVMLight added
Steven Hollidge <stevenhollidge@hotmail.com>
parents:
diff changeset
110 public event System.EventHandler<System.ComponentModel.AsyncCompletedEventArgs> OpenCompleted;
3591c26bd63e MVVMLight added
Steven Hollidge <stevenhollidge@hotmail.com>
parents:
diff changeset
111
3591c26bd63e MVVMLight added
Steven Hollidge <stevenhollidge@hotmail.com>
parents:
diff changeset
112 public event System.EventHandler<System.ComponentModel.AsyncCompletedEventArgs> CloseCompleted;
3591c26bd63e MVVMLight added
Steven Hollidge <stevenhollidge@hotmail.com>
parents:
diff changeset
113
3591c26bd63e MVVMLight added
Steven Hollidge <stevenhollidge@hotmail.com>
parents:
diff changeset
114 [System.ComponentModel.EditorBrowsableAttribute(System.ComponentModel.EditorBrowsableState.Advanced)]
3591c26bd63e MVVMLight added
Steven Hollidge <stevenhollidge@hotmail.com>
parents:
diff changeset
115 System.IAsyncResult SecureService.BeginDoWork(System.AsyncCallback callback, object asyncState)
3591c26bd63e MVVMLight added
Steven Hollidge <stevenhollidge@hotmail.com>
parents:
diff changeset
116 {
3591c26bd63e MVVMLight added
Steven Hollidge <stevenhollidge@hotmail.com>
parents:
diff changeset
117 return base.Channel.BeginDoWork(callback, asyncState);
3591c26bd63e MVVMLight added
Steven Hollidge <stevenhollidge@hotmail.com>
parents:
diff changeset
118 }
3591c26bd63e MVVMLight added
Steven Hollidge <stevenhollidge@hotmail.com>
parents:
diff changeset
119
3591c26bd63e MVVMLight added
Steven Hollidge <stevenhollidge@hotmail.com>
parents:
diff changeset
120 [System.ComponentModel.EditorBrowsableAttribute(System.ComponentModel.EditorBrowsableState.Advanced)]
3591c26bd63e MVVMLight added
Steven Hollidge <stevenhollidge@hotmail.com>
parents:
diff changeset
121 void SecureService.EndDoWork(System.IAsyncResult result)
3591c26bd63e MVVMLight added
Steven Hollidge <stevenhollidge@hotmail.com>
parents:
diff changeset
122 {
3591c26bd63e MVVMLight added
Steven Hollidge <stevenhollidge@hotmail.com>
parents:
diff changeset
123 base.Channel.EndDoWork(result);
3591c26bd63e MVVMLight added
Steven Hollidge <stevenhollidge@hotmail.com>
parents:
diff changeset
124 }
3591c26bd63e MVVMLight added
Steven Hollidge <stevenhollidge@hotmail.com>
parents:
diff changeset
125
3591c26bd63e MVVMLight added
Steven Hollidge <stevenhollidge@hotmail.com>
parents:
diff changeset
126 private System.IAsyncResult OnBeginDoWork(object[] inValues, System.AsyncCallback callback, object asyncState)
3591c26bd63e MVVMLight added
Steven Hollidge <stevenhollidge@hotmail.com>
parents:
diff changeset
127 {
3591c26bd63e MVVMLight added
Steven Hollidge <stevenhollidge@hotmail.com>
parents:
diff changeset
128 return ((SecureService)(this)).BeginDoWork(callback, asyncState);
3591c26bd63e MVVMLight added
Steven Hollidge <stevenhollidge@hotmail.com>
parents:
diff changeset
129 }
3591c26bd63e MVVMLight added
Steven Hollidge <stevenhollidge@hotmail.com>
parents:
diff changeset
130
3591c26bd63e MVVMLight added
Steven Hollidge <stevenhollidge@hotmail.com>
parents:
diff changeset
131 private object[] OnEndDoWork(System.IAsyncResult result)
3591c26bd63e MVVMLight added
Steven Hollidge <stevenhollidge@hotmail.com>
parents:
diff changeset
132 {
3591c26bd63e MVVMLight added
Steven Hollidge <stevenhollidge@hotmail.com>
parents:
diff changeset
133 ((SecureService)(this)).EndDoWork(result);
3591c26bd63e MVVMLight added
Steven Hollidge <stevenhollidge@hotmail.com>
parents:
diff changeset
134 return null;
3591c26bd63e MVVMLight added
Steven Hollidge <stevenhollidge@hotmail.com>
parents:
diff changeset
135 }
3591c26bd63e MVVMLight added
Steven Hollidge <stevenhollidge@hotmail.com>
parents:
diff changeset
136
3591c26bd63e MVVMLight added
Steven Hollidge <stevenhollidge@hotmail.com>
parents:
diff changeset
137 private void OnDoWorkCompleted(object state)
3591c26bd63e MVVMLight added
Steven Hollidge <stevenhollidge@hotmail.com>
parents:
diff changeset
138 {
3591c26bd63e MVVMLight added
Steven Hollidge <stevenhollidge@hotmail.com>
parents:
diff changeset
139 if ((this.DoWorkCompleted != null))
3591c26bd63e MVVMLight added
Steven Hollidge <stevenhollidge@hotmail.com>
parents:
diff changeset
140 {
3591c26bd63e MVVMLight added
Steven Hollidge <stevenhollidge@hotmail.com>
parents:
diff changeset
141 InvokeAsyncCompletedEventArgs e = ((InvokeAsyncCompletedEventArgs)(state));
3591c26bd63e MVVMLight added
Steven Hollidge <stevenhollidge@hotmail.com>
parents:
diff changeset
142 this.DoWorkCompleted(this, new System.ComponentModel.AsyncCompletedEventArgs(e.Error, e.Cancelled, e.UserState));
3591c26bd63e MVVMLight added
Steven Hollidge <stevenhollidge@hotmail.com>
parents:
diff changeset
143 }
3591c26bd63e MVVMLight added
Steven Hollidge <stevenhollidge@hotmail.com>
parents:
diff changeset
144 }
3591c26bd63e MVVMLight added
Steven Hollidge <stevenhollidge@hotmail.com>
parents:
diff changeset
145
3591c26bd63e MVVMLight added
Steven Hollidge <stevenhollidge@hotmail.com>
parents:
diff changeset
146 public void DoWorkAsync()
3591c26bd63e MVVMLight added
Steven Hollidge <stevenhollidge@hotmail.com>
parents:
diff changeset
147 {
3591c26bd63e MVVMLight added
Steven Hollidge <stevenhollidge@hotmail.com>
parents:
diff changeset
148 this.DoWorkAsync(null);
3591c26bd63e MVVMLight added
Steven Hollidge <stevenhollidge@hotmail.com>
parents:
diff changeset
149 }
3591c26bd63e MVVMLight added
Steven Hollidge <stevenhollidge@hotmail.com>
parents:
diff changeset
150
3591c26bd63e MVVMLight added
Steven Hollidge <stevenhollidge@hotmail.com>
parents:
diff changeset
151 public void DoWorkAsync(object userState)
3591c26bd63e MVVMLight added
Steven Hollidge <stevenhollidge@hotmail.com>
parents:
diff changeset
152 {
3591c26bd63e MVVMLight added
Steven Hollidge <stevenhollidge@hotmail.com>
parents:
diff changeset
153 if ((this.onBeginDoWorkDelegate == null))
3591c26bd63e MVVMLight added
Steven Hollidge <stevenhollidge@hotmail.com>
parents:
diff changeset
154 {
3591c26bd63e MVVMLight added
Steven Hollidge <stevenhollidge@hotmail.com>
parents:
diff changeset
155 this.onBeginDoWorkDelegate = new BeginOperationDelegate(this.OnBeginDoWork);
3591c26bd63e MVVMLight added
Steven Hollidge <stevenhollidge@hotmail.com>
parents:
diff changeset
156 }
3591c26bd63e MVVMLight added
Steven Hollidge <stevenhollidge@hotmail.com>
parents:
diff changeset
157 if ((this.onEndDoWorkDelegate == null))
3591c26bd63e MVVMLight added
Steven Hollidge <stevenhollidge@hotmail.com>
parents:
diff changeset
158 {
3591c26bd63e MVVMLight added
Steven Hollidge <stevenhollidge@hotmail.com>
parents:
diff changeset
159 this.onEndDoWorkDelegate = new EndOperationDelegate(this.OnEndDoWork);
3591c26bd63e MVVMLight added
Steven Hollidge <stevenhollidge@hotmail.com>
parents:
diff changeset
160 }
3591c26bd63e MVVMLight added
Steven Hollidge <stevenhollidge@hotmail.com>
parents:
diff changeset
161 if ((this.onDoWorkCompletedDelegate == null))
3591c26bd63e MVVMLight added
Steven Hollidge <stevenhollidge@hotmail.com>
parents:
diff changeset
162 {
3591c26bd63e MVVMLight added
Steven Hollidge <stevenhollidge@hotmail.com>
parents:
diff changeset
163 this.onDoWorkCompletedDelegate = new System.Threading.SendOrPostCallback(this.OnDoWorkCompleted);
3591c26bd63e MVVMLight added
Steven Hollidge <stevenhollidge@hotmail.com>
parents:
diff changeset
164 }
3591c26bd63e MVVMLight added
Steven Hollidge <stevenhollidge@hotmail.com>
parents:
diff changeset
165 base.InvokeAsync(this.onBeginDoWorkDelegate, null, this.onEndDoWorkDelegate, this.onDoWorkCompletedDelegate, userState);
3591c26bd63e MVVMLight added
Steven Hollidge <stevenhollidge@hotmail.com>
parents:
diff changeset
166 }
3591c26bd63e MVVMLight added
Steven Hollidge <stevenhollidge@hotmail.com>
parents:
diff changeset
167
3591c26bd63e MVVMLight added
Steven Hollidge <stevenhollidge@hotmail.com>
parents:
diff changeset
168 private System.IAsyncResult OnBeginOpen(object[] inValues, System.AsyncCallback callback, object asyncState)
3591c26bd63e MVVMLight added
Steven Hollidge <stevenhollidge@hotmail.com>
parents:
diff changeset
169 {
3591c26bd63e MVVMLight added
Steven Hollidge <stevenhollidge@hotmail.com>
parents:
diff changeset
170 return ((System.ServiceModel.ICommunicationObject)(this)).BeginOpen(callback, asyncState);
3591c26bd63e MVVMLight added
Steven Hollidge <stevenhollidge@hotmail.com>
parents:
diff changeset
171 }
3591c26bd63e MVVMLight added
Steven Hollidge <stevenhollidge@hotmail.com>
parents:
diff changeset
172
3591c26bd63e MVVMLight added
Steven Hollidge <stevenhollidge@hotmail.com>
parents:
diff changeset
173 private object[] OnEndOpen(System.IAsyncResult result)
3591c26bd63e MVVMLight added
Steven Hollidge <stevenhollidge@hotmail.com>
parents:
diff changeset
174 {
3591c26bd63e MVVMLight added
Steven Hollidge <stevenhollidge@hotmail.com>
parents:
diff changeset
175 ((System.ServiceModel.ICommunicationObject)(this)).EndOpen(result);
3591c26bd63e MVVMLight added
Steven Hollidge <stevenhollidge@hotmail.com>
parents:
diff changeset
176 return null;
3591c26bd63e MVVMLight added
Steven Hollidge <stevenhollidge@hotmail.com>
parents:
diff changeset
177 }
3591c26bd63e MVVMLight added
Steven Hollidge <stevenhollidge@hotmail.com>
parents:
diff changeset
178
3591c26bd63e MVVMLight added
Steven Hollidge <stevenhollidge@hotmail.com>
parents:
diff changeset
179 private void OnOpenCompleted(object state)
3591c26bd63e MVVMLight added
Steven Hollidge <stevenhollidge@hotmail.com>
parents:
diff changeset
180 {
3591c26bd63e MVVMLight added
Steven Hollidge <stevenhollidge@hotmail.com>
parents:
diff changeset
181 if ((this.OpenCompleted != null))
3591c26bd63e MVVMLight added
Steven Hollidge <stevenhollidge@hotmail.com>
parents:
diff changeset
182 {
3591c26bd63e MVVMLight added
Steven Hollidge <stevenhollidge@hotmail.com>
parents:
diff changeset
183 InvokeAsyncCompletedEventArgs e = ((InvokeAsyncCompletedEventArgs)(state));
3591c26bd63e MVVMLight added
Steven Hollidge <stevenhollidge@hotmail.com>
parents:
diff changeset
184 this.OpenCompleted(this, new System.ComponentModel.AsyncCompletedEventArgs(e.Error, e.Cancelled, e.UserState));
3591c26bd63e MVVMLight added
Steven Hollidge <stevenhollidge@hotmail.com>
parents:
diff changeset
185 }
3591c26bd63e MVVMLight added
Steven Hollidge <stevenhollidge@hotmail.com>
parents:
diff changeset
186 }
3591c26bd63e MVVMLight added
Steven Hollidge <stevenhollidge@hotmail.com>
parents:
diff changeset
187
3591c26bd63e MVVMLight added
Steven Hollidge <stevenhollidge@hotmail.com>
parents:
diff changeset
188 public void OpenAsync()
3591c26bd63e MVVMLight added
Steven Hollidge <stevenhollidge@hotmail.com>
parents:
diff changeset
189 {
3591c26bd63e MVVMLight added
Steven Hollidge <stevenhollidge@hotmail.com>
parents:
diff changeset
190 this.OpenAsync(null);
3591c26bd63e MVVMLight added
Steven Hollidge <stevenhollidge@hotmail.com>
parents:
diff changeset
191 }
3591c26bd63e MVVMLight added
Steven Hollidge <stevenhollidge@hotmail.com>
parents:
diff changeset
192
3591c26bd63e MVVMLight added
Steven Hollidge <stevenhollidge@hotmail.com>
parents:
diff changeset
193 public void OpenAsync(object userState)
3591c26bd63e MVVMLight added
Steven Hollidge <stevenhollidge@hotmail.com>
parents:
diff changeset
194 {
3591c26bd63e MVVMLight added
Steven Hollidge <stevenhollidge@hotmail.com>
parents:
diff changeset
195 if ((this.onBeginOpenDelegate == null))
3591c26bd63e MVVMLight added
Steven Hollidge <stevenhollidge@hotmail.com>
parents:
diff changeset
196 {
3591c26bd63e MVVMLight added
Steven Hollidge <stevenhollidge@hotmail.com>
parents:
diff changeset
197 this.onBeginOpenDelegate = new BeginOperationDelegate(this.OnBeginOpen);
3591c26bd63e MVVMLight added
Steven Hollidge <stevenhollidge@hotmail.com>
parents:
diff changeset
198 }
3591c26bd63e MVVMLight added
Steven Hollidge <stevenhollidge@hotmail.com>
parents:
diff changeset
199 if ((this.onEndOpenDelegate == null))
3591c26bd63e MVVMLight added
Steven Hollidge <stevenhollidge@hotmail.com>
parents:
diff changeset
200 {
3591c26bd63e MVVMLight added
Steven Hollidge <stevenhollidge@hotmail.com>
parents:
diff changeset
201 this.onEndOpenDelegate = new EndOperationDelegate(this.OnEndOpen);
3591c26bd63e MVVMLight added
Steven Hollidge <stevenhollidge@hotmail.com>
parents:
diff changeset
202 }
3591c26bd63e MVVMLight added
Steven Hollidge <stevenhollidge@hotmail.com>
parents:
diff changeset
203 if ((this.onOpenCompletedDelegate == null))
3591c26bd63e MVVMLight added
Steven Hollidge <stevenhollidge@hotmail.com>
parents:
diff changeset
204 {
3591c26bd63e MVVMLight added
Steven Hollidge <stevenhollidge@hotmail.com>
parents:
diff changeset
205 this.onOpenCompletedDelegate = new System.Threading.SendOrPostCallback(this.OnOpenCompleted);
3591c26bd63e MVVMLight added
Steven Hollidge <stevenhollidge@hotmail.com>
parents:
diff changeset
206 }
3591c26bd63e MVVMLight added
Steven Hollidge <stevenhollidge@hotmail.com>
parents:
diff changeset
207 base.InvokeAsync(this.onBeginOpenDelegate, null, this.onEndOpenDelegate, this.onOpenCompletedDelegate, userState);
3591c26bd63e MVVMLight added
Steven Hollidge <stevenhollidge@hotmail.com>
parents:
diff changeset
208 }
3591c26bd63e MVVMLight added
Steven Hollidge <stevenhollidge@hotmail.com>
parents:
diff changeset
209
3591c26bd63e MVVMLight added
Steven Hollidge <stevenhollidge@hotmail.com>
parents:
diff changeset
210 private System.IAsyncResult OnBeginClose(object[] inValues, System.AsyncCallback callback, object asyncState)
3591c26bd63e MVVMLight added
Steven Hollidge <stevenhollidge@hotmail.com>
parents:
diff changeset
211 {
3591c26bd63e MVVMLight added
Steven Hollidge <stevenhollidge@hotmail.com>
parents:
diff changeset
212 return ((System.ServiceModel.ICommunicationObject)(this)).BeginClose(callback, asyncState);
3591c26bd63e MVVMLight added
Steven Hollidge <stevenhollidge@hotmail.com>
parents:
diff changeset
213 }
3591c26bd63e MVVMLight added
Steven Hollidge <stevenhollidge@hotmail.com>
parents:
diff changeset
214
3591c26bd63e MVVMLight added
Steven Hollidge <stevenhollidge@hotmail.com>
parents:
diff changeset
215 private object[] OnEndClose(System.IAsyncResult result)
3591c26bd63e MVVMLight added
Steven Hollidge <stevenhollidge@hotmail.com>
parents:
diff changeset
216 {
3591c26bd63e MVVMLight added
Steven Hollidge <stevenhollidge@hotmail.com>
parents:
diff changeset
217 ((System.ServiceModel.ICommunicationObject)(this)).EndClose(result);
3591c26bd63e MVVMLight added
Steven Hollidge <stevenhollidge@hotmail.com>
parents:
diff changeset
218 return null;
3591c26bd63e MVVMLight added
Steven Hollidge <stevenhollidge@hotmail.com>
parents:
diff changeset
219 }
3591c26bd63e MVVMLight added
Steven Hollidge <stevenhollidge@hotmail.com>
parents:
diff changeset
220
3591c26bd63e MVVMLight added
Steven Hollidge <stevenhollidge@hotmail.com>
parents:
diff changeset
221 private void OnCloseCompleted(object state)
3591c26bd63e MVVMLight added
Steven Hollidge <stevenhollidge@hotmail.com>
parents:
diff changeset
222 {
3591c26bd63e MVVMLight added
Steven Hollidge <stevenhollidge@hotmail.com>
parents:
diff changeset
223 if ((this.CloseCompleted != null))
3591c26bd63e MVVMLight added
Steven Hollidge <stevenhollidge@hotmail.com>
parents:
diff changeset
224 {
3591c26bd63e MVVMLight added
Steven Hollidge <stevenhollidge@hotmail.com>
parents:
diff changeset
225 InvokeAsyncCompletedEventArgs e = ((InvokeAsyncCompletedEventArgs)(state));
3591c26bd63e MVVMLight added
Steven Hollidge <stevenhollidge@hotmail.com>
parents:
diff changeset
226 this.CloseCompleted(this, new System.ComponentModel.AsyncCompletedEventArgs(e.Error, e.Cancelled, e.UserState));
3591c26bd63e MVVMLight added
Steven Hollidge <stevenhollidge@hotmail.com>
parents:
diff changeset
227 }
3591c26bd63e MVVMLight added
Steven Hollidge <stevenhollidge@hotmail.com>
parents:
diff changeset
228 }
3591c26bd63e MVVMLight added
Steven Hollidge <stevenhollidge@hotmail.com>
parents:
diff changeset
229
3591c26bd63e MVVMLight added
Steven Hollidge <stevenhollidge@hotmail.com>
parents:
diff changeset
230 public void CloseAsync()
3591c26bd63e MVVMLight added
Steven Hollidge <stevenhollidge@hotmail.com>
parents:
diff changeset
231 {
3591c26bd63e MVVMLight added
Steven Hollidge <stevenhollidge@hotmail.com>
parents:
diff changeset
232 this.CloseAsync(null);
3591c26bd63e MVVMLight added
Steven Hollidge <stevenhollidge@hotmail.com>
parents:
diff changeset
233 }
3591c26bd63e MVVMLight added
Steven Hollidge <stevenhollidge@hotmail.com>
parents:
diff changeset
234
3591c26bd63e MVVMLight added
Steven Hollidge <stevenhollidge@hotmail.com>
parents:
diff changeset
235 public void CloseAsync(object userState)
3591c26bd63e MVVMLight added
Steven Hollidge <stevenhollidge@hotmail.com>
parents:
diff changeset
236 {
3591c26bd63e MVVMLight added
Steven Hollidge <stevenhollidge@hotmail.com>
parents:
diff changeset
237 if ((this.onBeginCloseDelegate == null))
3591c26bd63e MVVMLight added
Steven Hollidge <stevenhollidge@hotmail.com>
parents:
diff changeset
238 {
3591c26bd63e MVVMLight added
Steven Hollidge <stevenhollidge@hotmail.com>
parents:
diff changeset
239 this.onBeginCloseDelegate = new BeginOperationDelegate(this.OnBeginClose);
3591c26bd63e MVVMLight added
Steven Hollidge <stevenhollidge@hotmail.com>
parents:
diff changeset
240 }
3591c26bd63e MVVMLight added
Steven Hollidge <stevenhollidge@hotmail.com>
parents:
diff changeset
241 if ((this.onEndCloseDelegate == null))
3591c26bd63e MVVMLight added
Steven Hollidge <stevenhollidge@hotmail.com>
parents:
diff changeset
242 {
3591c26bd63e MVVMLight added
Steven Hollidge <stevenhollidge@hotmail.com>
parents:
diff changeset
243 this.onEndCloseDelegate = new EndOperationDelegate(this.OnEndClose);
3591c26bd63e MVVMLight added
Steven Hollidge <stevenhollidge@hotmail.com>
parents:
diff changeset
244 }
3591c26bd63e MVVMLight added
Steven Hollidge <stevenhollidge@hotmail.com>
parents:
diff changeset
245 if ((this.onCloseCompletedDelegate == null))
3591c26bd63e MVVMLight added
Steven Hollidge <stevenhollidge@hotmail.com>
parents:
diff changeset
246 {
3591c26bd63e MVVMLight added
Steven Hollidge <stevenhollidge@hotmail.com>
parents:
diff changeset
247 this.onCloseCompletedDelegate = new System.Threading.SendOrPostCallback(this.OnCloseCompleted);
3591c26bd63e MVVMLight added
Steven Hollidge <stevenhollidge@hotmail.com>
parents:
diff changeset
248 }
3591c26bd63e MVVMLight added
Steven Hollidge <stevenhollidge@hotmail.com>
parents:
diff changeset
249 base.InvokeAsync(this.onBeginCloseDelegate, null, this.onEndCloseDelegate, this.onCloseCompletedDelegate, userState);
3591c26bd63e MVVMLight added
Steven Hollidge <stevenhollidge@hotmail.com>
parents:
diff changeset
250 }
3591c26bd63e MVVMLight added
Steven Hollidge <stevenhollidge@hotmail.com>
parents:
diff changeset
251
3591c26bd63e MVVMLight added
Steven Hollidge <stevenhollidge@hotmail.com>
parents:
diff changeset
252 protected override SecureService CreateChannel()
3591c26bd63e MVVMLight added
Steven Hollidge <stevenhollidge@hotmail.com>
parents:
diff changeset
253 {
3591c26bd63e MVVMLight added
Steven Hollidge <stevenhollidge@hotmail.com>
parents:
diff changeset
254 return new SecureServiceClientChannel(this);
3591c26bd63e MVVMLight added
Steven Hollidge <stevenhollidge@hotmail.com>
parents:
diff changeset
255 }
3591c26bd63e MVVMLight added
Steven Hollidge <stevenhollidge@hotmail.com>
parents:
diff changeset
256
3591c26bd63e MVVMLight added
Steven Hollidge <stevenhollidge@hotmail.com>
parents:
diff changeset
257 private class SecureServiceClientChannel : ChannelBase<SecureService>, SecureService
3591c26bd63e MVVMLight added
Steven Hollidge <stevenhollidge@hotmail.com>
parents:
diff changeset
258 {
3591c26bd63e MVVMLight added
Steven Hollidge <stevenhollidge@hotmail.com>
parents:
diff changeset
259
3591c26bd63e MVVMLight added
Steven Hollidge <stevenhollidge@hotmail.com>
parents:
diff changeset
260 public SecureServiceClientChannel(System.ServiceModel.ClientBase<SecureService> client) :
3591c26bd63e MVVMLight added
Steven Hollidge <stevenhollidge@hotmail.com>
parents:
diff changeset
261 base(client)
3591c26bd63e MVVMLight added
Steven Hollidge <stevenhollidge@hotmail.com>
parents:
diff changeset
262 {
3591c26bd63e MVVMLight added
Steven Hollidge <stevenhollidge@hotmail.com>
parents:
diff changeset
263 }
3591c26bd63e MVVMLight added
Steven Hollidge <stevenhollidge@hotmail.com>
parents:
diff changeset
264
3591c26bd63e MVVMLight added
Steven Hollidge <stevenhollidge@hotmail.com>
parents:
diff changeset
265 public System.IAsyncResult BeginDoWork(System.AsyncCallback callback, object asyncState)
3591c26bd63e MVVMLight added
Steven Hollidge <stevenhollidge@hotmail.com>
parents:
diff changeset
266 {
3591c26bd63e MVVMLight added
Steven Hollidge <stevenhollidge@hotmail.com>
parents:
diff changeset
267 object[] _args = new object[0];
3591c26bd63e MVVMLight added
Steven Hollidge <stevenhollidge@hotmail.com>
parents:
diff changeset
268 System.IAsyncResult _result = base.BeginInvoke("DoWork", _args, callback, asyncState);
3591c26bd63e MVVMLight added
Steven Hollidge <stevenhollidge@hotmail.com>
parents:
diff changeset
269 return _result;
3591c26bd63e MVVMLight added
Steven Hollidge <stevenhollidge@hotmail.com>
parents:
diff changeset
270 }
3591c26bd63e MVVMLight added
Steven Hollidge <stevenhollidge@hotmail.com>
parents:
diff changeset
271
3591c26bd63e MVVMLight added
Steven Hollidge <stevenhollidge@hotmail.com>
parents:
diff changeset
272 public void EndDoWork(System.IAsyncResult result)
3591c26bd63e MVVMLight added
Steven Hollidge <stevenhollidge@hotmail.com>
parents:
diff changeset
273 {
3591c26bd63e MVVMLight added
Steven Hollidge <stevenhollidge@hotmail.com>
parents:
diff changeset
274 object[] _args = new object[0];
3591c26bd63e MVVMLight added
Steven Hollidge <stevenhollidge@hotmail.com>
parents:
diff changeset
275 base.EndInvoke("DoWork", _args, result);
3591c26bd63e MVVMLight added
Steven Hollidge <stevenhollidge@hotmail.com>
parents:
diff changeset
276 }
3591c26bd63e MVVMLight added
Steven Hollidge <stevenhollidge@hotmail.com>
parents:
diff changeset
277 }
3591c26bd63e MVVMLight added
Steven Hollidge <stevenhollidge@hotmail.com>
parents:
diff changeset
278 }