protected void WriteScriptXml(XmlWriter writer, Script script) { writer.WriteStartElement(ELEMENT_SCRIPT); writer.WriteAttributeString(ATTRIBUTE_TYPE, script.GetType().AssemblyQualifiedName); if (script.ContentResource is PackageScriptResource) writer.WriteAttributeString(ATTRIBUTE_LOCATION, ((PackageScriptResource)script.ContentResource).UnpackagedLocation); else writer.WriteAttributeString(ATTRIBUTE_LOCATION, script.ContentResource.Location); writer.WriteStartElement(ELEMENT_CONNECTION); writer.WriteAttributeString(ATTRIBUTE_NAME, script.Connection.ConnectionName); writer.WriteAttributeString(ATTRIBUTE_CONNECTION_STRING, script.Connection.ConnectionString); writer.WriteEndElement(); writer.WriteStartElement(ELEMENT_DATA); writer.WriteValue(script.ScriptContents); writer.WriteEndElement(); writer.WriteEndElement(); }