1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 118 119 120 121 122 123 124 125 126 127 128 129 130 131 132 133 134 135 136 137 138 139 140 141 142 143 144 145 146 147 148 149 150 151 152 153 154 155 156 157 158 159 160 161 162 163 164 165 166 167 168 169 170 171 172 173 174 175 176 177 178 179 180 181 182 183 184 185 186 187 188 189 190 191 192
|
//------------------------------------------------------------
// Copyright (c) Microsoft Corporation. All rights reserved.
//------------------------------------------------------------
namespace System.ServiceModel.MsmqIntegration
{
using System.ComponentModel;
using System.Messaging;
using System.Runtime;
public sealed class MsmqIntegrationMessageProperty
{
public const string Name = "MsmqIntegrationMessageProperty";
public static MsmqIntegrationMessageProperty Get(System.ServiceModel.Channels.Message message)
{
if (null == message)
throw DiagnosticUtility.ExceptionUtility.ThrowHelperArgumentNull("message");
if (null == message.Properties)
throw DiagnosticUtility.ExceptionUtility.ThrowHelperArgumentNull("message.Properties");
return message.Properties[Name] as MsmqIntegrationMessageProperty;
}
object body;
public object Body
{
get { return this.body; }
set { this.body = value; }
}
AcknowledgeTypes? acknowledgeType = null;
public AcknowledgeTypes? AcknowledgeType
{
get { return this.acknowledgeType; }
set { this.acknowledgeType = value; }
}
Acknowledgment? acknowledgment = null;
public Acknowledgment? Acknowledgment
{
get { return this.acknowledgment; }
internal set { this.acknowledgment = value; }
}
Uri administrationQueue = null;
public Uri AdministrationQueue
{
get { return this.administrationQueue; }
set { this.administrationQueue = value; }
}
int? appSpecific = null;
public int? AppSpecific
{
get { return this.appSpecific; }
set { this.appSpecific = value; }
}
DateTime? arrivedTime = null;
public DateTime? ArrivedTime
{
get { return this.arrivedTime; }
internal set { this.arrivedTime = value; }
}
bool? authenticated = null;
public bool? Authenticated
{
get { return this.authenticated; }
internal set { this.authenticated = value; }
}
int? bodyType = null;
public int? BodyType
{
get { return this.bodyType; }
set { this.bodyType = value; }
}
string correlationId = null;
public string CorrelationId
{
get { return this.correlationId; }
set { this.correlationId = value; }
}
Uri destinationQueue = null;
public Uri DestinationQueue
{
get { return this.destinationQueue; }
internal set { this.destinationQueue = value; }
}
byte[] extension = null;
public byte[] Extension
{
get { return this.extension; }
set { this.extension = value; }
}
string id = null;
public string Id
{
get { return this.id; }
internal set { this.id = value; }
}
string label = null;
public string Label
{
get { return this.label; }
set { this.label = value; }
}
MessageType? messageType = null;
public MessageType? MessageType
{
get { return this.messageType; }
internal set { this.messageType = value; }
}
MessagePriority? priority = null;
public MessagePriority? Priority
{
get { return this.priority; }
set
{
ValidateMessagePriority(value);
this.priority = value;
}
}
Uri responseQueue = null;
public Uri ResponseQueue
{
get { return this.responseQueue; }
set { this.responseQueue = value; }
}
byte[] senderId = null;
public byte[] SenderId
{
get { return this.senderId; }
internal set { this.senderId = value; }
}
DateTime? sentTime = null;
public DateTime? SentTime
{
get { return this.sentTime; }
internal set { this.sentTime = value; }
}
TimeSpan? timeToReachQueue = null;
public TimeSpan? TimeToReachQueue
{
get { return this.timeToReachQueue; }
set
{
ValidateTimeToReachQueue(value);
this.timeToReachQueue = value;
}
}
internal void InternalSetTimeToReachQueue(TimeSpan timeout)
{
this.timeToReachQueue = timeout;
}
static void ValidateMessagePriority(MessagePriority? priority)
{
if (priority.HasValue && (priority.Value < MessagePriority.Lowest || priority.Value > MessagePriority.Highest))
throw DiagnosticUtility.ExceptionUtility.ThrowHelperError(new InvalidEnumArgumentException("priority", (int)priority, typeof(MessagePriority)));
}
static void ValidateTimeToReachQueue(TimeSpan? timeout)
{
if (timeout.HasValue && timeout.Value < TimeSpan.Zero)
{
throw DiagnosticUtility.ExceptionUtility.ThrowHelperError(new ArgumentOutOfRangeException("value", timeout,
SR.GetString(SR.SFxTimeoutOutOfRange0)));
}
if (timeout.HasValue && TimeoutHelper.IsTooLarge(timeout.Value))
{
throw DiagnosticUtility.ExceptionUtility.ThrowHelperError(new ArgumentOutOfRangeException("value", timeout,
SR.GetString(SR.SFxTimeoutOutOfRangeTooBig)));
}
}
}
}
|