Exemple #1
0
        private static QueueInformation GetInfo(string formatName)
        {
            var props = new QueueProperties();

            //props.SetNull(Native.QUEUE_PROPID_CREATE_TIME);
            props.SetNull(Native.QUEUE_PROPID_LABEL);

            int status = Native.GetQueueProperties(formatName, props.Allocate());

            props.Free();
            if (Native.IsError(status))
            {
                throw new QueueException(status);
            }

            string label  = "";
            IntPtr handle = props.GetIntPtr(Native.QUEUE_PROPID_LABEL);

            if (handle != IntPtr.Zero)
            {
                label = Marshal.PtrToStringUni(handle);
                Native.FreeMemory(handle);
            }

            return(new QueueInformation {
                FormatName = formatName, Label = label
            });
        }
Exemple #2
0
        /// <summary>Returns the transactional property of the queue</summary>
        public static QueueTransactional IsTransactional(string formatName)
        {
            Contract.Requires(formatName != null);
            var props = new QueueProperties();

            props.SetByte(Native.QUEUE_PROPID_TRANSACTION, 0);
            int status = Native.GetQueueProperties(formatName, props.Allocate());

            props.Free();
            if (Native.IsError(status))
            {
                throw new QueueException(status);
            }

            return((QueueTransactional)props.GetByte(Native.QUEUE_PROPID_TRANSACTION));
        }