/******************************************************************
* Copyright(c) Suzsoft DotNet Group
* Description : MessageQueue helper class
* CreateDate : 2006-05-11 02:28:58
* Creater : QCao
* LastChangeDate:
* LastChanger :
* Version Info :
* ******************************************************************/
using System;
using System.Collections.Generic;
using System.Text;
using System.Messaging;
namespace Suzsoft.Alarming.Service
{
/// <summary>
/// Message Queue helper class
/// </summary>
/// <typeparam name="T"></typeparam>
public class MessageQueueHelper<T> : MarshalByRefObject where T : class, new()
{
public MessageQueueHelper(string path)
{
m_AllowException = true;
if (MessageQueue.Exists(path))
m_Msq = new MessageQueue(path);
else
{
m_Msq = MessageQueue.Create(path);
m_Msq.MaximumQueueSize = CommonSettings.QueueMaxSize;
}
m_Msq.SetPermissions("Everyone", System.Messaging.MessageQueueAccessRights.FullControl);