Reference.cs 22 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444
  1. //------------------------------------------------------------------------------
  2. // <auto-generated>
  3. // This code was generated by a tool.
  4. // Runtime Version:4.0.30319.1
  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. // This code was auto-generated by Microsoft.Silverlight.Phone.ServiceReference, version 3.7.0.0
  12. //
  13. namespace WindowsPhone.Recipes.Push.Client.Services {
  14. using System.Runtime.Serialization;
  15. [System.Diagnostics.DebuggerStepThroughAttribute()]
  16. [System.CodeDom.Compiler.GeneratedCodeAttribute("System.Runtime.Serialization", "4.0.0.0")]
  17. [System.Runtime.Serialization.DataContractAttribute(Name="ServerInfo", Namespace="http://schemas.datacontract.org/2004/07/WindowsPhone.Recipes.Push.Server.Models")]
  18. public partial class ServerInfo : object, System.ComponentModel.INotifyPropertyChanged {
  19. private int CounterField;
  20. private string PushPatternField;
  21. [System.Runtime.Serialization.DataMemberAttribute()]
  22. public int Counter {
  23. get {
  24. return this.CounterField;
  25. }
  26. set {
  27. if ((this.CounterField.Equals(value) != true)) {
  28. this.CounterField = value;
  29. this.RaisePropertyChanged("Counter");
  30. }
  31. }
  32. }
  33. [System.Runtime.Serialization.DataMemberAttribute()]
  34. public string PushPattern {
  35. get {
  36. return this.PushPatternField;
  37. }
  38. set {
  39. if ((object.ReferenceEquals(this.PushPatternField, value) != true)) {
  40. this.PushPatternField = value;
  41. this.RaisePropertyChanged("PushPattern");
  42. }
  43. }
  44. }
  45. public event System.ComponentModel.PropertyChangedEventHandler PropertyChanged;
  46. protected void RaisePropertyChanged(string propertyName) {
  47. System.ComponentModel.PropertyChangedEventHandler propertyChanged = this.PropertyChanged;
  48. if ((propertyChanged != null)) {
  49. propertyChanged(this, new System.ComponentModel.PropertyChangedEventArgs(propertyName));
  50. }
  51. }
  52. }
  53. [System.CodeDom.Compiler.GeneratedCodeAttribute("System.ServiceModel", "4.0.0.0")]
  54. [System.ServiceModel.ServiceContractAttribute(ConfigurationName="Services.IPushService")]
  55. public interface IPushService {
  56. [System.ServiceModel.OperationContractAttribute(AsyncPattern=true, Action="http://tempuri.org/IPushService/Register", ReplyAction="http://tempuri.org/IPushService/RegisterResponse")]
  57. System.IAsyncResult BeginRegister(string userName, System.Uri channelUri, System.AsyncCallback callback, object asyncState);
  58. void EndRegister(System.IAsyncResult result);
  59. [System.ServiceModel.OperationContractAttribute(AsyncPattern=true, Action="http://tempuri.org/IPushService/GetServerInfo", ReplyAction="http://tempuri.org/IPushService/GetServerInfoResponse")]
  60. System.IAsyncResult BeginGetServerInfo(System.AsyncCallback callback, object asyncState);
  61. WindowsPhone.Recipes.Push.Client.Services.ServerInfo EndGetServerInfo(System.IAsyncResult result);
  62. [System.ServiceModel.OperationContractAttribute(AsyncPattern=true, Action="http://tempuri.org/IPushService/UpdateTile", ReplyAction="http://tempuri.org/IPushService/UpdateTileResponse")]
  63. System.IAsyncResult BeginUpdateTile(System.Uri channelUri, string parameter, System.AsyncCallback callback, object asyncState);
  64. void EndUpdateTile(System.IAsyncResult result);
  65. }
  66. [System.CodeDom.Compiler.GeneratedCodeAttribute("System.ServiceModel", "4.0.0.0")]
  67. public interface IPushServiceChannel : WindowsPhone.Recipes.Push.Client.Services.IPushService, System.ServiceModel.IClientChannel {
  68. }
  69. [System.Diagnostics.DebuggerStepThroughAttribute()]
  70. [System.CodeDom.Compiler.GeneratedCodeAttribute("System.ServiceModel", "4.0.0.0")]
  71. public partial class GetServerInfoCompletedEventArgs : System.ComponentModel.AsyncCompletedEventArgs {
  72. private object[] results;
  73. public GetServerInfoCompletedEventArgs(object[] results, System.Exception exception, bool cancelled, object userState) :
  74. base(exception, cancelled, userState) {
  75. this.results = results;
  76. }
  77. public WindowsPhone.Recipes.Push.Client.Services.ServerInfo Result {
  78. get {
  79. base.RaiseExceptionIfNecessary();
  80. return ((WindowsPhone.Recipes.Push.Client.Services.ServerInfo)(this.results[0]));
  81. }
  82. }
  83. }
  84. [System.Diagnostics.DebuggerStepThroughAttribute()]
  85. [System.CodeDom.Compiler.GeneratedCodeAttribute("System.ServiceModel", "4.0.0.0")]
  86. public partial class PushServiceClient : System.ServiceModel.ClientBase<WindowsPhone.Recipes.Push.Client.Services.IPushService>, WindowsPhone.Recipes.Push.Client.Services.IPushService {
  87. private BeginOperationDelegate onBeginRegisterDelegate;
  88. private EndOperationDelegate onEndRegisterDelegate;
  89. private System.Threading.SendOrPostCallback onRegisterCompletedDelegate;
  90. private BeginOperationDelegate onBeginGetServerInfoDelegate;
  91. private EndOperationDelegate onEndGetServerInfoDelegate;
  92. private System.Threading.SendOrPostCallback onGetServerInfoCompletedDelegate;
  93. private BeginOperationDelegate onBeginUpdateTileDelegate;
  94. private EndOperationDelegate onEndUpdateTileDelegate;
  95. private System.Threading.SendOrPostCallback onUpdateTileCompletedDelegate;
  96. private BeginOperationDelegate onBeginOpenDelegate;
  97. private EndOperationDelegate onEndOpenDelegate;
  98. private System.Threading.SendOrPostCallback onOpenCompletedDelegate;
  99. private BeginOperationDelegate onBeginCloseDelegate;
  100. private EndOperationDelegate onEndCloseDelegate;
  101. private System.Threading.SendOrPostCallback onCloseCompletedDelegate;
  102. public PushServiceClient() {
  103. }
  104. public PushServiceClient(string endpointConfigurationName) :
  105. base(endpointConfigurationName) {
  106. }
  107. public PushServiceClient(string endpointConfigurationName, string remoteAddress) :
  108. base(endpointConfigurationName, remoteAddress) {
  109. }
  110. public PushServiceClient(string endpointConfigurationName, System.ServiceModel.EndpointAddress remoteAddress) :
  111. base(endpointConfigurationName, remoteAddress) {
  112. }
  113. public PushServiceClient(System.ServiceModel.Channels.Binding binding, System.ServiceModel.EndpointAddress remoteAddress) :
  114. base(binding, remoteAddress) {
  115. }
  116. public System.Net.CookieContainer CookieContainer {
  117. get {
  118. System.ServiceModel.Channels.IHttpCookieContainerManager httpCookieContainerManager = this.InnerChannel.GetProperty<System.ServiceModel.Channels.IHttpCookieContainerManager>();
  119. if ((httpCookieContainerManager != null)) {
  120. return httpCookieContainerManager.CookieContainer;
  121. }
  122. else {
  123. return null;
  124. }
  125. }
  126. set {
  127. System.ServiceModel.Channels.IHttpCookieContainerManager httpCookieContainerManager = this.InnerChannel.GetProperty<System.ServiceModel.Channels.IHttpCookieContainerManager>();
  128. if ((httpCookieContainerManager != null)) {
  129. httpCookieContainerManager.CookieContainer = value;
  130. }
  131. else {
  132. throw new System.InvalidOperationException("Unable to set the CookieContainer. Please make sure the binding contains an HttpC" +
  133. "ookieContainerBindingElement.");
  134. }
  135. }
  136. }
  137. public event System.EventHandler<System.ComponentModel.AsyncCompletedEventArgs> RegisterCompleted;
  138. public event System.EventHandler<GetServerInfoCompletedEventArgs> GetServerInfoCompleted;
  139. public event System.EventHandler<System.ComponentModel.AsyncCompletedEventArgs> UpdateTileCompleted;
  140. public event System.EventHandler<System.ComponentModel.AsyncCompletedEventArgs> OpenCompleted;
  141. public event System.EventHandler<System.ComponentModel.AsyncCompletedEventArgs> CloseCompleted;
  142. [System.ComponentModel.EditorBrowsableAttribute(System.ComponentModel.EditorBrowsableState.Advanced)]
  143. System.IAsyncResult WindowsPhone.Recipes.Push.Client.Services.IPushService.BeginRegister(string userName, System.Uri channelUri, System.AsyncCallback callback, object asyncState) {
  144. return base.Channel.BeginRegister(userName, channelUri, callback, asyncState);
  145. }
  146. [System.ComponentModel.EditorBrowsableAttribute(System.ComponentModel.EditorBrowsableState.Advanced)]
  147. void WindowsPhone.Recipes.Push.Client.Services.IPushService.EndRegister(System.IAsyncResult result) {
  148. base.Channel.EndRegister(result);
  149. }
  150. private System.IAsyncResult OnBeginRegister(object[] inValues, System.AsyncCallback callback, object asyncState) {
  151. string userName = ((string)(inValues[0]));
  152. System.Uri channelUri = ((System.Uri)(inValues[1]));
  153. return ((WindowsPhone.Recipes.Push.Client.Services.IPushService)(this)).BeginRegister(userName, channelUri, callback, asyncState);
  154. }
  155. private object[] OnEndRegister(System.IAsyncResult result) {
  156. ((WindowsPhone.Recipes.Push.Client.Services.IPushService)(this)).EndRegister(result);
  157. return null;
  158. }
  159. private void OnRegisterCompleted(object state) {
  160. if ((this.RegisterCompleted != null)) {
  161. InvokeAsyncCompletedEventArgs e = ((InvokeAsyncCompletedEventArgs)(state));
  162. this.RegisterCompleted(this, new System.ComponentModel.AsyncCompletedEventArgs(e.Error, e.Cancelled, e.UserState));
  163. }
  164. }
  165. public void RegisterAsync(string userName, System.Uri channelUri) {
  166. this.RegisterAsync(userName, channelUri, null);
  167. }
  168. public void RegisterAsync(string userName, System.Uri channelUri, object userState) {
  169. if ((this.onBeginRegisterDelegate == null)) {
  170. this.onBeginRegisterDelegate = new BeginOperationDelegate(this.OnBeginRegister);
  171. }
  172. if ((this.onEndRegisterDelegate == null)) {
  173. this.onEndRegisterDelegate = new EndOperationDelegate(this.OnEndRegister);
  174. }
  175. if ((this.onRegisterCompletedDelegate == null)) {
  176. this.onRegisterCompletedDelegate = new System.Threading.SendOrPostCallback(this.OnRegisterCompleted);
  177. }
  178. base.InvokeAsync(this.onBeginRegisterDelegate, new object[] {
  179. userName,
  180. channelUri}, this.onEndRegisterDelegate, this.onRegisterCompletedDelegate, userState);
  181. }
  182. [System.ComponentModel.EditorBrowsableAttribute(System.ComponentModel.EditorBrowsableState.Advanced)]
  183. System.IAsyncResult WindowsPhone.Recipes.Push.Client.Services.IPushService.BeginGetServerInfo(System.AsyncCallback callback, object asyncState) {
  184. return base.Channel.BeginGetServerInfo(callback, asyncState);
  185. }
  186. [System.ComponentModel.EditorBrowsableAttribute(System.ComponentModel.EditorBrowsableState.Advanced)]
  187. WindowsPhone.Recipes.Push.Client.Services.ServerInfo WindowsPhone.Recipes.Push.Client.Services.IPushService.EndGetServerInfo(System.IAsyncResult result) {
  188. return base.Channel.EndGetServerInfo(result);
  189. }
  190. private System.IAsyncResult OnBeginGetServerInfo(object[] inValues, System.AsyncCallback callback, object asyncState) {
  191. return ((WindowsPhone.Recipes.Push.Client.Services.IPushService)(this)).BeginGetServerInfo(callback, asyncState);
  192. }
  193. private object[] OnEndGetServerInfo(System.IAsyncResult result) {
  194. WindowsPhone.Recipes.Push.Client.Services.ServerInfo retVal = ((WindowsPhone.Recipes.Push.Client.Services.IPushService)(this)).EndGetServerInfo(result);
  195. return new object[] {
  196. retVal};
  197. }
  198. private void OnGetServerInfoCompleted(object state) {
  199. if ((this.GetServerInfoCompleted != null)) {
  200. InvokeAsyncCompletedEventArgs e = ((InvokeAsyncCompletedEventArgs)(state));
  201. this.GetServerInfoCompleted(this, new GetServerInfoCompletedEventArgs(e.Results, e.Error, e.Cancelled, e.UserState));
  202. }
  203. }
  204. public void GetServerInfoAsync() {
  205. this.GetServerInfoAsync(null);
  206. }
  207. public void GetServerInfoAsync(object userState) {
  208. if ((this.onBeginGetServerInfoDelegate == null)) {
  209. this.onBeginGetServerInfoDelegate = new BeginOperationDelegate(this.OnBeginGetServerInfo);
  210. }
  211. if ((this.onEndGetServerInfoDelegate == null)) {
  212. this.onEndGetServerInfoDelegate = new EndOperationDelegate(this.OnEndGetServerInfo);
  213. }
  214. if ((this.onGetServerInfoCompletedDelegate == null)) {
  215. this.onGetServerInfoCompletedDelegate = new System.Threading.SendOrPostCallback(this.OnGetServerInfoCompleted);
  216. }
  217. base.InvokeAsync(this.onBeginGetServerInfoDelegate, null, this.onEndGetServerInfoDelegate, this.onGetServerInfoCompletedDelegate, userState);
  218. }
  219. [System.ComponentModel.EditorBrowsableAttribute(System.ComponentModel.EditorBrowsableState.Advanced)]
  220. System.IAsyncResult WindowsPhone.Recipes.Push.Client.Services.IPushService.BeginUpdateTile(System.Uri channelUri, string parameter, System.AsyncCallback callback, object asyncState) {
  221. return base.Channel.BeginUpdateTile(channelUri, parameter, callback, asyncState);
  222. }
  223. [System.ComponentModel.EditorBrowsableAttribute(System.ComponentModel.EditorBrowsableState.Advanced)]
  224. void WindowsPhone.Recipes.Push.Client.Services.IPushService.EndUpdateTile(System.IAsyncResult result) {
  225. base.Channel.EndUpdateTile(result);
  226. }
  227. private System.IAsyncResult OnBeginUpdateTile(object[] inValues, System.AsyncCallback callback, object asyncState) {
  228. System.Uri channelUri = ((System.Uri)(inValues[0]));
  229. string parameter = ((string)(inValues[1]));
  230. return ((WindowsPhone.Recipes.Push.Client.Services.IPushService)(this)).BeginUpdateTile(channelUri, parameter, callback, asyncState);
  231. }
  232. private object[] OnEndUpdateTile(System.IAsyncResult result) {
  233. ((WindowsPhone.Recipes.Push.Client.Services.IPushService)(this)).EndUpdateTile(result);
  234. return null;
  235. }
  236. private void OnUpdateTileCompleted(object state) {
  237. if ((this.UpdateTileCompleted != null)) {
  238. InvokeAsyncCompletedEventArgs e = ((InvokeAsyncCompletedEventArgs)(state));
  239. this.UpdateTileCompleted(this, new System.ComponentModel.AsyncCompletedEventArgs(e.Error, e.Cancelled, e.UserState));
  240. }
  241. }
  242. public void UpdateTileAsync(System.Uri channelUri, string parameter) {
  243. this.UpdateTileAsync(channelUri, parameter, null);
  244. }
  245. public void UpdateTileAsync(System.Uri channelUri, string parameter, object userState) {
  246. if ((this.onBeginUpdateTileDelegate == null)) {
  247. this.onBeginUpdateTileDelegate = new BeginOperationDelegate(this.OnBeginUpdateTile);
  248. }
  249. if ((this.onEndUpdateTileDelegate == null)) {
  250. this.onEndUpdateTileDelegate = new EndOperationDelegate(this.OnEndUpdateTile);
  251. }
  252. if ((this.onUpdateTileCompletedDelegate == null)) {
  253. this.onUpdateTileCompletedDelegate = new System.Threading.SendOrPostCallback(this.OnUpdateTileCompleted);
  254. }
  255. base.InvokeAsync(this.onBeginUpdateTileDelegate, new object[] {
  256. channelUri,
  257. parameter}, this.onEndUpdateTileDelegate, this.onUpdateTileCompletedDelegate, userState);
  258. }
  259. private System.IAsyncResult OnBeginOpen(object[] inValues, System.AsyncCallback callback, object asyncState) {
  260. return ((System.ServiceModel.ICommunicationObject)(this)).BeginOpen(callback, asyncState);
  261. }
  262. private object[] OnEndOpen(System.IAsyncResult result) {
  263. ((System.ServiceModel.ICommunicationObject)(this)).EndOpen(result);
  264. return null;
  265. }
  266. private void OnOpenCompleted(object state) {
  267. if ((this.OpenCompleted != null)) {
  268. InvokeAsyncCompletedEventArgs e = ((InvokeAsyncCompletedEventArgs)(state));
  269. this.OpenCompleted(this, new System.ComponentModel.AsyncCompletedEventArgs(e.Error, e.Cancelled, e.UserState));
  270. }
  271. }
  272. public void OpenAsync() {
  273. this.OpenAsync(null);
  274. }
  275. public void OpenAsync(object userState) {
  276. if ((this.onBeginOpenDelegate == null)) {
  277. this.onBeginOpenDelegate = new BeginOperationDelegate(this.OnBeginOpen);
  278. }
  279. if ((this.onEndOpenDelegate == null)) {
  280. this.onEndOpenDelegate = new EndOperationDelegate(this.OnEndOpen);
  281. }
  282. if ((this.onOpenCompletedDelegate == null)) {
  283. this.onOpenCompletedDelegate = new System.Threading.SendOrPostCallback(this.OnOpenCompleted);
  284. }
  285. base.InvokeAsync(this.onBeginOpenDelegate, null, this.onEndOpenDelegate, this.onOpenCompletedDelegate, userState);
  286. }
  287. private System.IAsyncResult OnBeginClose(object[] inValues, System.AsyncCallback callback, object asyncState) {
  288. return ((System.ServiceModel.ICommunicationObject)(this)).BeginClose(callback, asyncState);
  289. }
  290. private object[] OnEndClose(System.IAsyncResult result) {
  291. ((System.ServiceModel.ICommunicationObject)(this)).EndClose(result);
  292. return null;
  293. }
  294. private void OnCloseCompleted(object state) {
  295. if ((this.CloseCompleted != null)) {
  296. InvokeAsyncCompletedEventArgs e = ((InvokeAsyncCompletedEventArgs)(state));
  297. this.CloseCompleted(this, new System.ComponentModel.AsyncCompletedEventArgs(e.Error, e.Cancelled, e.UserState));
  298. }
  299. }
  300. public void CloseAsync() {
  301. this.CloseAsync(null);
  302. }
  303. public void CloseAsync(object userState) {
  304. if ((this.onBeginCloseDelegate == null)) {
  305. this.onBeginCloseDelegate = new BeginOperationDelegate(this.OnBeginClose);
  306. }
  307. if ((this.onEndCloseDelegate == null)) {
  308. this.onEndCloseDelegate = new EndOperationDelegate(this.OnEndClose);
  309. }
  310. if ((this.onCloseCompletedDelegate == null)) {
  311. this.onCloseCompletedDelegate = new System.Threading.SendOrPostCallback(this.OnCloseCompleted);
  312. }
  313. base.InvokeAsync(this.onBeginCloseDelegate, null, this.onEndCloseDelegate, this.onCloseCompletedDelegate, userState);
  314. }
  315. protected override WindowsPhone.Recipes.Push.Client.Services.IPushService CreateChannel() {
  316. return new PushServiceClientChannel(this);
  317. }
  318. private class PushServiceClientChannel : ChannelBase<WindowsPhone.Recipes.Push.Client.Services.IPushService>, WindowsPhone.Recipes.Push.Client.Services.IPushService {
  319. public PushServiceClientChannel(System.ServiceModel.ClientBase<WindowsPhone.Recipes.Push.Client.Services.IPushService> client) :
  320. base(client) {
  321. }
  322. public System.IAsyncResult BeginRegister(string userName, System.Uri channelUri, System.AsyncCallback callback, object asyncState) {
  323. object[] _args = new object[2];
  324. _args[0] = userName;
  325. _args[1] = channelUri;
  326. System.IAsyncResult _result = base.BeginInvoke("Register", _args, callback, asyncState);
  327. return _result;
  328. }
  329. public void EndRegister(System.IAsyncResult result) {
  330. object[] _args = new object[0];
  331. base.EndInvoke("Register", _args, result);
  332. }
  333. public System.IAsyncResult BeginGetServerInfo(System.AsyncCallback callback, object asyncState) {
  334. object[] _args = new object[0];
  335. System.IAsyncResult _result = base.BeginInvoke("GetServerInfo", _args, callback, asyncState);
  336. return _result;
  337. }
  338. public WindowsPhone.Recipes.Push.Client.Services.ServerInfo EndGetServerInfo(System.IAsyncResult result) {
  339. object[] _args = new object[0];
  340. WindowsPhone.Recipes.Push.Client.Services.ServerInfo _result = ((WindowsPhone.Recipes.Push.Client.Services.ServerInfo)(base.EndInvoke("GetServerInfo", _args, result)));
  341. return _result;
  342. }
  343. public System.IAsyncResult BeginUpdateTile(System.Uri channelUri, string parameter, System.AsyncCallback callback, object asyncState) {
  344. object[] _args = new object[2];
  345. _args[0] = channelUri;
  346. _args[1] = parameter;
  347. System.IAsyncResult _result = base.BeginInvoke("UpdateTile", _args, callback, asyncState);
  348. return _result;
  349. }
  350. public void EndUpdateTile(System.IAsyncResult result) {
  351. object[] _args = new object[0];
  352. base.EndInvoke("UpdateTile", _args, result);
  353. }
  354. }
  355. }
  356. }