MsmqMessage.cs 3.2 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132
  1. //
  2. // MsmqMessage.cs
  3. //
  4. // Author: Atsushi Enomoto <[email protected]>
  5. //
  6. // Copyright (C) 2007 Novell, Inc (http://www.novell.com)
  7. //
  8. // Permission is hereby granted, free of charge, to any person obtaining
  9. // a copy of this software and associated documentation files (the
  10. // "Software"), to deal in the Software without restriction, including
  11. // without limitation the rights to use, copy, modify, merge, publish,
  12. // distribute, sublicense, and/or sell copies of the Software, and to
  13. // permit persons to whom the Software is furnished to do so, subject to
  14. // the following conditions:
  15. //
  16. // The above copyright notice and this permission notice shall be
  17. // included in all copies or substantial portions of the Software.
  18. //
  19. // THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
  20. // EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
  21. // MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
  22. // NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE
  23. // LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION
  24. // OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION
  25. // WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
  26. //
  27. using System;
  28. using System.Messaging;
  29. using System.ServiceModel;
  30. namespace System.ServiceModel.MsmqIntegration
  31. {
  32. [MessageContract]
  33. public sealed class MsmqMessage<T>
  34. {
  35. MsmqIntegrationMessageProperty prop;
  36. public MsmqMessage (T body)
  37. {
  38. prop = new MsmqIntegrationMessageProperty ();
  39. Body = body;
  40. }
  41. public AcknowledgeTypes? AcknowledgeType {
  42. get { return prop.AcknowledgeType; }
  43. set { prop.AcknowledgeType = value; }
  44. }
  45. public Acknowledgment? Acknowledgment {
  46. get { return prop.Acknowledgment; }
  47. }
  48. public Uri AdministrationQueue {
  49. get { return prop.AdministrationQueue; }
  50. set { prop.AdministrationQueue = value; }
  51. }
  52. public int? AppSpecific {
  53. get { return prop.AppSpecific; }
  54. set { prop.AppSpecific = value; }
  55. }
  56. public DateTime? ArrivedTime {
  57. get { return prop.ArrivedTime; }
  58. }
  59. public bool? Authenticated {
  60. get { return prop.Authenticated; }
  61. }
  62. public T Body {
  63. get { return (T) prop.Body; }
  64. set { prop.Body = value; }
  65. }
  66. public int? BodyType {
  67. get { return prop.BodyType; }
  68. set { prop.BodyType = value; }
  69. }
  70. public string CorrelationId {
  71. get { return prop.CorrelationId; }
  72. set { prop.CorrelationId = value; }
  73. }
  74. public Uri DestinationQueue {
  75. get { return prop.DestinationQueue; }
  76. }
  77. public byte [] Extension {
  78. get { return prop.Extension; }
  79. set { prop.Extension = value; }
  80. }
  81. public string Id {
  82. get { return prop.Id; }
  83. }
  84. public string Label {
  85. get { return prop.Label; }
  86. set { prop.Label = value; }
  87. }
  88. public MessageType? MessageType {
  89. get { return prop.MessageType; }
  90. }
  91. public MessagePriority? Priority {
  92. get { return prop.Priority; }
  93. set { prop.Priority = value; }
  94. }
  95. public Uri ResponseQueue {
  96. get { return prop.ResponseQueue; }
  97. set { prop.ResponseQueue = value; }
  98. }
  99. public byte [] SenderId {
  100. get { return prop.SenderId; }
  101. }
  102. public DateTime? SentTime {
  103. get { return prop.SentTime; }
  104. }
  105. public TimeSpan? TimeToReachQueue {
  106. get { return prop.TimeToReachQueue; }
  107. set { prop.TimeToReachQueue = value; }
  108. }
  109. }
  110. }