OperationDescription.cs 3.7 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134
  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. public MethodInfo BeginMethod {
  60. get { return begin_method; }
  61. set { begin_method = value; }
  62. }
  63. [MonoTODO]
  64. public KeyedByTypeCollection<IOperationBehavior> Behaviors {
  65. get { return behaviors; }
  66. }
  67. public ContractDescription DeclaringContract {
  68. get { return contract; }
  69. set { contract = value; }
  70. }
  71. public MethodInfo EndMethod {
  72. get { return end_method; }
  73. set { end_method = value; }
  74. }
  75. [MonoTODO]
  76. public FaultDescriptionCollection Faults {
  77. get { return faults; }
  78. }
  79. public bool HasProtectionLevel {
  80. get { return has_protection_level; }
  81. }
  82. public bool IsInitiating {
  83. get { return is_initiating; }
  84. set { is_initiating = value; }
  85. }
  86. public bool IsOneWay {
  87. get { return is_oneway; }
  88. // LAMESPEC: I believe there should be a setter since
  89. // otherwise OperationContractAttribute.set_IsOneWay() does not make sense.
  90. internal set { is_oneway = value; }
  91. }
  92. public bool IsTerminating {
  93. get { return is_terminating; }
  94. set { is_terminating = value; }
  95. }
  96. [MonoTODO]
  97. public Collection<Type> KnownTypes {
  98. get { return known_types; }
  99. }
  100. public MessageDescriptionCollection Messages {
  101. get { return messages; }
  102. }
  103. public string Name {
  104. get { return name; }
  105. }
  106. public ProtectionLevel ProtectionLevel {
  107. get { return protection_level; }
  108. set {
  109. protection_level = value;
  110. has_protection_level = true;
  111. }
  112. }
  113. public MethodInfo SyncMethod {
  114. get { return sync_method; }
  115. set { sync_method = value; }
  116. }
  117. }
  118. }