Exemplo n.º 1
0
		/// <summary>
		/// Duplicates a message.
		/// </summary>
		/// <param name="sourceQueue">Queue which contains the message to duplicate.</param>
		/// <param name="sourceMessageId">ID of message to duplicate.</param>
		/// <returns>New <see cref="Message"/>.</returns>
		public Message DuplicateMessage(QSetMessageQueue sourceQueue, string sourceMessageId)
		{
			sourceQueue.MessageReadPropertyFilter.Body = true;
			sourceQueue.MessageReadPropertyFilter.Label = true;
			Message sourceMessage = sourceQueue.PeekById(sourceMessageId);
			sourceMessage.Formatter = new XmlMessageFormatter();
			System.Messaging.Message newMessage = new System.Messaging.Message();			
			Mulholland.Core.IOUtilities.CopyStream(sourceMessage.BodyStream, newMessage.BodyStream);
			newMessage.Label = sourceMessage.Label;

			return newMessage;
		}
Exemplo n.º 2
0
		/// <summary>
		/// Constructs the queue item.
		/// </summary>
		/// <param name="guid">The items ID (GUID).</param>
		/// <param name="name">Full path/ name of queue.</param>		
		public QSetQueueItem(Guid guid, string name) 
			: base(guid, name, Images.IconType.Queue) 
		{
			_qsetMessageQueue = null;						
		}
Exemplo n.º 3
0
 /// <summary>
 /// Constructs the queue item.
 /// </summary>
 /// <param name="guid">The items ID (GUID).</param>
 /// <param name="name">Full path/ name of queue.</param>
 public QSetQueueItem(Guid guid, string name)
     : base(guid, name, Images.IconType.Queue)
 {
     _qsetMessageQueue = null;
 }