OperationDescription.cs 3.7 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137
  1. //
  2. // OperationDescription.cs
  3. //
  4. // Author:
  5. // Atsushi Enomoto <[email protected]>
  6. //
  7. // Copyright (C) 2005 Novell, Inc. http://www.novell.com
  8. //
  9. // Permission is hereby granted, free of charge, to any person obtaining
  10. // a copy of this software and associated documentation files (the
  11. // "Software"), to deal in the Software without restriction, including
  12. // without limitation the rights to use, copy, modify, merge, publish,
  13. // distribute, sublicense, and/or sell copies of the Software, and to
  14. // permit persons to whom the Software is furnished to do so, subject to
  15. // the following conditions:
  16. //
  17. // The above copyright notice and this permission notice shall be
  18. // included in all copies or substantial portions of the Software.
  19. //
  20. // THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
  21. // EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
  22. // MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
  23. // NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE
  24. // LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION
  25. // OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION
  26. // WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
  27. //
  28. using System;
  29. using System.Collections.Generic;
  30. using System.Collections.ObjectModel;
  31. using System.Net.Security;
  32. using System.Reflection;
  33. using System.Runtime.Serialization;
  34. using System.ServiceModel;
  35. namespace System.ServiceModel.Description
  36. {
  37. public class OperationDescription
  38. {
  39. MethodInfo begin_method, end_method, sync_method;
  40. FaultDescriptionCollection faults
  41. = new FaultDescriptionCollection ();
  42. ContractDescription contract;
  43. KeyedByTypeCollection<IOperationBehavior> behaviors
  44. = new KeyedByTypeCollection<IOperationBehavior> ();
  45. bool is_initiating, is_oneway, is_terminating;
  46. Collection<Type> known_types = new Collection<Type> ();
  47. MessageDescriptionCollection messages
  48. = new MessageDescriptionCollection ();
  49. string name;
  50. ProtectionLevel protection_level;
  51. bool has_protection_level;
  52. public OperationDescription (string name,
  53. ContractDescription declaringContract)
  54. {
  55. this.name = name;
  56. contract = declaringContract;
  57. is_initiating = true;
  58. }
  59. [MonoTODO]
  60. public MethodInfo BeginMethod {
  61. get { return begin_method; }
  62. set { begin_method = value; }
  63. }
  64. [MonoTODO]
  65. public KeyedByTypeCollection<IOperationBehavior> Behaviors {
  66. get { return behaviors; }
  67. }
  68. public ContractDescription DeclaringContract {
  69. get { return contract; }
  70. set { contract = value; }
  71. }
  72. [MonoTODO]
  73. public MethodInfo EndMethod {
  74. get { return end_method; }
  75. set { end_method = value; }
  76. }
  77. [MonoTODO]
  78. public FaultDescriptionCollection Faults {
  79. get { return faults; }
  80. }
  81. public bool HasProtectionLevel {
  82. get { return has_protection_level; }
  83. }
  84. public bool IsInitiating {
  85. get { return is_initiating; }
  86. set { is_initiating = value; }
  87. }
  88. public bool IsOneWay {
  89. get { return is_oneway; }
  90. // LAMESPEC: I believe there should be a setter since
  91. // otherwise OperationContractAttribute.set_IsOneWay() does not make sense.
  92. internal set { is_oneway = value; }
  93. }
  94. public bool IsTerminating {
  95. get { return is_terminating; }
  96. set { is_terminating = value; }
  97. }
  98. [MonoTODO]
  99. public Collection<Type> KnownTypes {
  100. get { return known_types; }
  101. }
  102. [MonoTODO]
  103. public MessageDescriptionCollection Messages {
  104. get { return messages; }
  105. }
  106. public string Name {
  107. get { return name; }
  108. }
  109. public ProtectionLevel ProtectionLevel {
  110. get { return protection_level; }
  111. set {
  112. protection_level = value;
  113. has_protection_level = true;
  114. }
  115. }
  116. public MethodInfo SyncMethod {
  117. get { return sync_method; }
  118. set { sync_method = value; }
  119. }
  120. }
  121. }