示例#1
0
        protected override void WriteXml(System.Xml.XmlWriter xml, WriteXmlContext context)
        {
            if (xml == null)
            {
                throw new ArgumentNullException("xml");
            }
            if (context == null)
            {
                throw new ArgumentNullException("context");
            }

            // set...
            xml.WriteElementString("NamespaceName", this.NamespaceName);
            xml.WriteElementString("BaseType", this.BaseType);
            xml.WriteElementString("DtoBaseType", this.DtoBaseType);
            //			xml.WriteElementString("ConnectionString", this.ConnectionString);
            //			if(this.ConnectionType != null)
            //				xml.WriteElementString("ConnectionType", string.Format("{0},{1}", this.ConnectionType.FullName,
            //					this.ConnectionType.Assembly.GetName().Name));
            xml.WriteElementString("DatabaseName", this.DatabaseName);
            xml.WriteElementString("TargetVersion", this.TargetVersion.ToString());

            // mbr - 29-11-2007 - for c7 - added generation type...
            xml.WriteElementString(GenerationTypeNameKey, this.GenerationTypeName);
        }
示例#2
0
 /// <summary>
 /// Outputs the XML.
 /// </summary>
 /// <param name="xml"></param>
 /// <param name="context"></param>
 protected override void WriteXml(System.Xml.XmlWriter xml, WriteXmlContext context)
 {
     // add...
     xml.WriteStartElement("Tables");
     foreach (SqlTable table in this.Tables)
     {
         table.ToXml(xml, context.Encoding);
     }
     xml.WriteEndElement();
 }
示例#3
0
        protected override void WriteXml(System.Xml.XmlWriter xml, WriteXmlContext context)
        {
            if (xml == null)
            {
                throw new ArgumentNullException("xml");
            }
            if (context == null)
            {
                throw new ArgumentNullException("context");
            }

            // output...
            xml.WriteElementString("Name", this.Name);
        }
示例#4
0
        protected override void WriteXml(System.Xml.XmlWriter xml, WriteXmlContext context)
        {
            if (xml == null)
            {
                throw new ArgumentNullException("xml");
            }
            if (context == null)
            {
                throw new ArgumentNullException("context");
            }

            // mbr - 25-09-2007 - provider.
            if (Database.ExtensibilityProvider == null)
            {
                throw new InvalidOperationException("Database.ExtensibilityProvider is null.");
            }

            // mbr - 25-09-2007 - this isn't lovely, but the default provider uses a defunct serialisation method.
            // it's easier to keep the old method (because it works, it's just not best practice), and if we
            // have a new provider, get the provider to do it.

            // add the schema version...
            xml.WriteAttributeString("providerType", string.Format("{0}, {1}", Database.ExtensibilityProvider.GetType().FullName,
                                                                   Database.ExtensibilityProvider.GetType().Assembly.GetName().Name));
            xml.WriteAttributeString("schemaVersion", FlatTableExtensibilityProvider.XmlSchemaVersion.ToString());

            xml.WriteStartElement("Lookups");
            foreach (ExtendedLookupDefinition lookup in Lookups.GetLookups())
            {
                lookup.ToXml(xml);
            }
            xml.WriteEndElement();

            // create...
            xml.WriteStartElement("ExtendedProperties");
            foreach (ExtendedPropertyDefinition property in Properties)
            {
                property.ToXml(xml);
            }
            xml.WriteEndElement();
        }
示例#5
0
        protected override void WriteXml(System.Xml.XmlWriter xml, WriteXmlContext context)
        {
            base.WriteXml(xml, context);

            // indexes...
            xml.WriteStartElement("Indexes");
            foreach (SqlIndex index in this.Indexes)
            {
                index.ToXml(xml, context.Encoding);
            }
            xml.WriteEndElement();

            // links...
            xml.WriteStartElement("ChildToParentLinks");
            foreach (SqlChildToParentLink link in this.LinksToParents)
            {
                link.ToXml(xml, context.Encoding);
            }
            xml.WriteEndElement();
            xml.WriteElementString("Modifiers", this.Modifiers.ToString());

            xml.WriteElementString("GenerateDto", this.GenerateDto.ToString());
        }
示例#6
0
        protected override void WriteXml(System.Xml.XmlWriter xml, WriteXmlContext context)
        {
            if (xml == null)
            {
                throw new ArgumentNullException("xml");
            }
            if (context == null)
            {
                throw new ArgumentNullException("context");
            }

            // settings...
            if (Settings == null)
            {
                throw new InvalidOperationException("Settings is null.");
            }

            // settings...
//			if(ExtendedPropertySettings == null)
//				throw new InvalidOperationException("ExtendedPropertySettings is null.");

            // settings...
            this.Settings.ToXml(xml, context);
            //this.ExtendedPropertySettings.ToXml(xml,context);

            // schema...
            if (this.Schema != null)
            {
                // write it...
                this.Schema.ToXml(xml, context);
            }
            else
            {
                // write a blank schema...
                xml.WriteElementString("Schema", string.Empty);
            }
        }