AsyncCallTesterProxy.cs 5.4 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155
  1. //------------------------------------------------------------------------------
  2. // <auto-generated>
  3. // This code was generated by a tool.
  4. // Runtime Version:2.0.50727.1433
  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. using System;
  11. using System.Collections.Generic;
  12. using System.Text;
  13. namespace Proxy.MonoTests.Features.Client
  14. {
  15. [System.CodeDom.Compiler.GeneratedCodeAttribute ("System.ServiceModel", "3.0.0.0")]
  16. [System.ServiceModel.ServiceContractAttribute (Namespace = "http://MonoTests.Features.Contracts", ConfigurationName = "IAsyncCallTesterContract")]
  17. public interface IAsyncCallTesterContract
  18. {
  19. [System.ServiceModel.OperationContractAttribute(Action = "http://MonoTests.Features.Contracts/IAsyncCallTesterContract/Query", ReplyAction = "http://MonoTests.Features.Contracts/IAsyncCallTesterContract/QueryResponse")]
  20. string Query (string query);
  21. [System.ServiceModel.OperationContractAttribute(AsyncPattern = true, Action = "http://MonoTests.Features.Contracts/IAsyncCallTesterContract/Query", ReplyAction = "http://MonoTests.Features.Contracts/IAsyncCallTesterContract/QueryResponse")]
  22. System.IAsyncResult BeginQuery (string query, System.AsyncCallback callback, object asyncState);
  23. string EndQuery (System.IAsyncResult result);
  24. }
  25. [System.CodeDom.Compiler.GeneratedCodeAttribute ("System.ServiceModel", "3.0.0.0")]
  26. public interface IAsyncCallTesterContractChannel : IAsyncCallTesterContract, System.ServiceModel.IClientChannel
  27. {
  28. }
  29. [System.Diagnostics.DebuggerStepThroughAttribute ()]
  30. [System.CodeDom.Compiler.GeneratedCodeAttribute ("System.ServiceModel", "3.0.0.0")]
  31. public partial class QueryCompletedEventArgs : System.ComponentModel.AsyncCompletedEventArgs
  32. {
  33. private object [] results;
  34. public QueryCompletedEventArgs (object [] results, System.Exception exception, bool cancelled, object userState) :
  35. base (exception, cancelled, userState)
  36. {
  37. this.results = results;
  38. }
  39. public string Result
  40. {
  41. get
  42. {
  43. base.RaiseExceptionIfNecessary ();
  44. return ((string) (this.results [0]));
  45. }
  46. }
  47. }
  48. [System.Diagnostics.DebuggerStepThroughAttribute ()]
  49. [System.CodeDom.Compiler.GeneratedCodeAttribute ("System.ServiceModel", "3.0.0.0")]
  50. public partial class AsyncCallTesterContractClient : System.ServiceModel.ClientBase<IAsyncCallTesterContract>, IAsyncCallTesterContract
  51. {
  52. private BeginOperationDelegate onBeginQueryDelegate;
  53. private EndOperationDelegate onEndQueryDelegate;
  54. private System.Threading.SendOrPostCallback onQueryCompletedDelegate;
  55. public AsyncCallTesterContractClient ()
  56. {
  57. }
  58. public AsyncCallTesterContractClient (string endpointConfigurationName) :
  59. base (endpointConfigurationName)
  60. {
  61. }
  62. public AsyncCallTesterContractClient (string endpointConfigurationName, string remoteAddress) :
  63. base (endpointConfigurationName, remoteAddress)
  64. {
  65. }
  66. public AsyncCallTesterContractClient (string endpointConfigurationName, System.ServiceModel.EndpointAddress remoteAddress) :
  67. base (endpointConfigurationName, remoteAddress)
  68. {
  69. }
  70. public AsyncCallTesterContractClient (System.ServiceModel.Channels.Binding binding, System.ServiceModel.EndpointAddress remoteAddress) :
  71. base (binding, remoteAddress)
  72. {
  73. }
  74. public event System.EventHandler<QueryCompletedEventArgs> QueryCompleted;
  75. public string Query (string query)
  76. {
  77. return base.Channel.Query (query);
  78. }
  79. [System.ComponentModel.EditorBrowsableAttribute (System.ComponentModel.EditorBrowsableState.Advanced)]
  80. public System.IAsyncResult BeginQuery (string query, System.AsyncCallback callback, object asyncState)
  81. {
  82. return base.Channel.BeginQuery (query, callback, asyncState);
  83. }
  84. [System.ComponentModel.EditorBrowsableAttribute (System.ComponentModel.EditorBrowsableState.Advanced)]
  85. public string EndQuery (System.IAsyncResult result)
  86. {
  87. return base.Channel.EndQuery (result);
  88. }
  89. private System.IAsyncResult OnBeginQuery (object [] inValues, System.AsyncCallback callback, object asyncState)
  90. {
  91. string s = ((string) (inValues [0]));
  92. return this.BeginQuery (s, callback, asyncState);
  93. }
  94. private object [] OnEndQuery (System.IAsyncResult result)
  95. {
  96. string retVal = this.EndQuery (result);
  97. return new object [] {
  98. retVal};
  99. }
  100. private void OnQueryCompleted (object state)
  101. {
  102. System.EventHandler<QueryCompletedEventArgs> handler = this.QueryCompleted;
  103. if ((handler != null)) {
  104. InvokeAsyncCompletedEventArgs e = ((InvokeAsyncCompletedEventArgs) (state));
  105. handler (this, new QueryCompletedEventArgs (e.Results, e.Error, e.Cancelled, e.UserState));
  106. }
  107. }
  108. public void QueryAsync (string query)
  109. {
  110. this.QueryAsync (query, null);
  111. }
  112. public void QueryAsync (string query, object userState)
  113. {
  114. if ((this.onBeginQueryDelegate == null)) {
  115. this.onBeginQueryDelegate = new BeginOperationDelegate (this.OnBeginQuery);
  116. }
  117. if ((this.onEndQueryDelegate == null)) {
  118. this.onEndQueryDelegate = new EndOperationDelegate (this.OnEndQuery);
  119. }
  120. if ((this.onQueryCompletedDelegate == null)) {
  121. this.onQueryCompletedDelegate = new System.Threading.SendOrPostCallback (this.OnQueryCompleted);
  122. }
  123. base.InvokeAsync (this.onBeginQueryDelegate, new object [] {
  124. query}, this.onEndQueryDelegate, this.onQueryCompletedDelegate, userState);
  125. }
  126. }
  127. }