Example #1
0
        /// <summary>
        /// Decompile the MessageQueue table.
        /// </summary>
        /// <param name="table">The table to decompile.</param>
        private void DecompileMessageQueueTable(Table table)
        {
            foreach (Row row in table.Rows)
            {
                Msmq.MessageQueue queue = new Msmq.MessageQueue();

                queue.Id = (string)row[0];

                if (null != row[2])
                {
                    queue.BasePriority = (int)row[2];
                }

                if (null != row[3])
                {
                    queue.JournalQuota = (int)row[3];
                }

                queue.Label = (string)row[4];

                if (null != row[5])
                {
                    queue.MulticastAddress = (string)row[5];
                }

                queue.PathName = (string)row[6];

                if (null != row[7])
                {
                    switch ((MsmqCompiler.MqiMessageQueuePrivacyLevel)row[7])
                    {
                    case MsmqCompiler.MqiMessageQueuePrivacyLevel.None:
                        queue.PrivLevel = Msmq.MessageQueue.PrivLevelType.none;
                        break;

                    case MsmqCompiler.MqiMessageQueuePrivacyLevel.Optional:
                        queue.PrivLevel = Msmq.MessageQueue.PrivLevelType.optional;
                        break;

                    case MsmqCompiler.MqiMessageQueuePrivacyLevel.Body:
                        queue.PrivLevel = Msmq.MessageQueue.PrivLevelType.body;
                        break;

                    default:
                        break;
                    }
                }

                if (null != row[8])
                {
                    queue.Quota = (int)row[8];
                }

                if (null != row[9])
                {
                    queue.ServiceTypeGuid = (string)row[9];
                }

                int attributes = (int)row[10];

                if (0 != (attributes & (int)MsmqCompiler.MqiMessageQueueAttributes.Authenticate))
                {
                    queue.Authenticate = Msmq.YesNoType.yes;
                }

                if (0 != (attributes & (int)MsmqCompiler.MqiMessageQueueAttributes.Journal))
                {
                    queue.Journal = Msmq.YesNoType.yes;
                }

                if (0 != (attributes & (int)MsmqCompiler.MqiMessageQueueAttributes.Transactional))
                {
                    queue.Transactional = Msmq.YesNoType.yes;
                }

                Wix.Component component = (Wix.Component) this.Core.GetIndexedElement("Component", (string)row[1]);
                if (null != component)
                {
                    component.AddChild(queue);
                }
                else
                {
                    this.Core.OnMessage(WixWarnings.ExpectedForeignRow(row.SourceLineNumbers, table.Name, row.GetPrimaryKey(DecompilerCore.PrimaryKeyDelimiter), "Component_", (string)row[1], "Component"));
                }
            }
        }
Example #2
0
        /// <summary>
        /// Decompile the MessageQueue table.
        /// </summary>
        /// <param name="table">The table to decompile.</param>
        private void DecompileMessageQueueTable(Table table)
        {
            foreach (Row row in table.Rows)
            {
                Msmq.MessageQueue queue = new Msmq.MessageQueue();

                queue.Id = (string)row[0];

                if (null != row[2])
                {
                    queue.BasePriority = (int)row[2];
                }

                if (null != row[3])
                {
                    queue.JournalQuota = (int)row[3];
                }

                queue.Label = (string)row[4];

                if (null != row[5])
                {
                    queue.MulticastAddress = (string)row[5];
                }

                queue.PathName = (string)row[6];

                if (null != row[7])
                {
                    switch ((MsmqCompiler.MqiMessageQueuePrivacyLevel)row[7])
                    {
                        case MsmqCompiler.MqiMessageQueuePrivacyLevel.None:
                            queue.PrivLevel = Msmq.MessageQueue.PrivLevelType.none;
                            break;
                        case MsmqCompiler.MqiMessageQueuePrivacyLevel.Optional:
                            queue.PrivLevel = Msmq.MessageQueue.PrivLevelType.optional;
                            break;
                        case MsmqCompiler.MqiMessageQueuePrivacyLevel.Body:
                            queue.PrivLevel = Msmq.MessageQueue.PrivLevelType.body;
                            break;
                        default:
                            break;
                    }
                }

                if (null != row[8])
                {
                    queue.Quota = (int)row[8];
                }

                if (null != row[9])
                {
                    queue.ServiceTypeGuid = (string)row[9];
                }

                int attributes = (int)row[10];

                if (0 != (attributes & (int)MsmqCompiler.MqiMessageQueueAttributes.Authenticate))
                {
                    queue.Authenticate = Msmq.YesNoType.yes;
                }

                if (0 != (attributes & (int)MsmqCompiler.MqiMessageQueueAttributes.Journal))
                {
                    queue.Journal = Msmq.YesNoType.yes;
                }

                if (0 != (attributes & (int)MsmqCompiler.MqiMessageQueueAttributes.Transactional))
                {
                    queue.Transactional = Msmq.YesNoType.yes;
                }

                Wix.Component component = (Wix.Component)this.Core.GetIndexedElement("Component", (string)row[1]);
                if (null != component)
                {
                    component.AddChild(queue);
                }
                else
                {
                    this.Core.OnMessage(WixWarnings.ExpectedForeignRow(row.SourceLineNumbers, table.Name, row.GetPrimaryKey(DecompilerCore.PrimaryKeyDelimiter), "Component_", (string)row[1], "Component"));
                }
            }
        }