Beispiel #1
0
        public void Create()
        {
            if (!this.ServiceBroker.MessageTypes.Contains(this.FullName))
            {
                // Create message types
                MessageType msgType = new MessageType(
                    this.ServiceBroker, this.FullName);

                msgType.MessageTypeValidation = this.MessageTypeValidation;

                if (msgType.MessageTypeValidation == MessageTypeValidation.XmlSchemaCollection)
                {
                    if (!this.ServiceBroker.Parent.XmlSchemaCollections.Contains
                            (this.ValidationXmlSchemaCollection) && !String.IsNullOrEmpty(this.ValidationXmlSchemaCollectionSchema))
                    {
                        XmlSchemaCollection schema = new XmlSchemaCollection
                                                         (this.ServiceBroker.Parent, this.ValidationXmlSchemaCollection);
                        schema.Text = this.ValidationXmlSchemaCollectionSchema;
                        schema.Create();
                    }

                    msgType.ValidationXmlSchemaCollection = this.ValidationXmlSchemaCollection;
                }
                msgType.Create();
            }
        }
Beispiel #2
0
        private static void CreateXMLSchema(Database database, string xmlSchemaName, string xmlSchemaText)
        {
            XmlSchemaCollection xsc = new XmlSchemaCollection(database, xmlSchemaName)
            {
                Text = xmlSchemaText
            };

            xsc.Create();
        }
        public void Create()
        {
            if (!this.ServiceBroker.MessageTypes.Contains(this.FullName))
            {
                // Create message types
                MessageType msgType = new MessageType(
                    this.ServiceBroker, this.FullName);

                msgType.MessageTypeValidation = this.MessageTypeValidation;

                if (msgType.MessageTypeValidation == MessageTypeValidation.XmlSchemaCollection)
                {
                    if(!this.ServiceBroker.Parent.XmlSchemaCollections.Contains
                        (this.ValidationXmlSchemaCollection) && ! String.IsNullOrEmpty(this.ValidationXmlSchemaCollectionSchema))
                    {
                        XmlSchemaCollection schema = new XmlSchemaCollection
                            (this.ServiceBroker.Parent, this.ValidationXmlSchemaCollection);
                        schema.Text = this.ValidationXmlSchemaCollectionSchema;
                        schema.Create();
                    }

                    msgType.ValidationXmlSchemaCollection = this.ValidationXmlSchemaCollection;
                }
                msgType.Create();
            }
        }