Thanks to Outlook Express here comes the .NET 2.0 XMLSerializer for
SqlParameter:
#if _DYNAMIC_XMLSERIALIZER_COMPILATION
[assembly:System.Security.AllowPartiallyTrustedCallers()]
[assembly:System.Security.SecurityTransparent()]
#endif
[assembly:System.Reflection.AssemblyVersionAttribute("2.0.0.0")]
[assembly:System.Xml.Serialization.XmlSerializerVersionAttribute(ParentAssemblyId=@"70bbeca7-72bc-4c00-862b-642b5f48a565,",
Version=@"2.0.0.0")]
namespace Microsoft.Xml.Serialization.GeneratedAssembly {
public class XmlSerializationWriterSqlParameter :
System.Xml.Serialization.XmlSerializationWriter {
public void Write10_SqlParameter(object o) {
WriteStartDocument();
if (o == null) {
WriteNullTagLiteral(@"SqlParameter", @"");
return;
}
TopLevelElement();
Write9_SqlParameter(@"SqlParameter", @"",
((global::System.Data.SqlClient.SqlParameter)o), true, false);
}
void Write9_SqlParameter(string n, string ns,
global::System.Data.SqlClient.SqlParameter o, bool isNullable, bool
needType) {
if ((object)o == null) {
if (isNullable) WriteNullTagLiteral(n, ns);
return;
}
if (!needType) {
System.Type t = o.GetType();
if (t == typeof(global::System.Data.SqlClient.SqlParameter))
{
}
else {
throw CreateUnknownTypeException(o);
}
}
WriteStartElement(n, ns, o, false, null);
if (needType) WriteXsiType(@"SqlParameter", @"");
WriteElementString(@"DbType", @"",
Write3_DbType(((global::System.Data.DbType)o.@DbType)));
if (((global::System.Data.ParameterDirection)o.@Direction) !=
global::System.Data.ParameterDirection.@Input) {
WriteElementString(@"Direction", @"",
Write4_ParameterDirection(((global::System.Data.ParameterDirection)o.@Direction)));
}
WriteElementStringRaw(@"IsNullable", @"",
System.Xml.XmlConvert.ToString((global::System.Boolean)((global::System.Boolean)o.@IsNullable)));
if ((((global::System.String)o.@ParameterName) != null) &&
(((global::System.String)o.@ParameterName).Length != 0)) {
WriteElementString(@"ParameterName", @"",
((global::System.String)o.@ParameterName));
}
WriteElementStringRaw(@"Size", @"",
System.Xml.XmlConvert.ToString((global::System.Int32)((global::System.Int32)o.@Size)));
if ((((global::System.String)o.@SourceColumn) != null) &&
(((global::System.String)o.@SourceColumn).Length != 0)) {
WriteElementString(@"SourceColumn", @"",
((global::System.String)o.@SourceColumn));
}
if (((global::System.Boolean)o.@SourceColumnNullMapping) !=
false) {
WriteElementStringRaw(@"SourceColumnNullMapping", @"",
System.Xml.XmlConvert.ToString((global::System.Boolean)((global::System.Boolean)o.@SourceColumnNullMapping)));
}
if (((global::System.Data.DataRowVersion)o.@SourceVersion) !=
global::System.Data.DataRowVersion.@Current) {
WriteElementString(@"SourceVersion", @"",
Write5_DataRowVersion(((global::System.Data.DataRowVersion)o.@SourceVersion)));
}
Write1_Object(@"Value", @"", ((global::System.Object)o.@Value),
false, false);
WriteElementString(@"CompareInfo", @"",
Write7_SqlCompareOptions(((global::System.Data.SqlTypes.SqlCompareOptions)o.@CompareInfo)));
WriteElementString(@"XmlSchemaCollectionDatabase", @"",
((global::System.String)o.@XmlSchemaCollectionDatabase));
WriteElementString(@"XmlSchemaCollectionOwningSchema", @"",
((global::System.String)o.@XmlSchemaCollectionOwningSchema));
WriteElementString(@"XmlSchemaCollectionName", @"",
((global::System.String)o.@XmlSchemaCollectionName));
WriteElementStringRaw(@"LocaleId", @"",
System.Xml.XmlConvert.ToString((global::System.Int32)((global::System.Int32)o.@LocaleId)));
if (((global::System.Byte)o.@Precision) != (System.Byte)(0)) {
WriteElementStringRaw(@"Precision", @"",
System.Xml.XmlConvert.ToString((global::System.Byte)((global::System.Byte)o.@Precision)));
}
if (((global::System.Byte)o.@Scale) != (System.Byte)(0)) {
WriteElementStringRaw(@"Scale", @"",
System.Xml.XmlConvert.ToString((global::System.Byte)((global::System.Byte)o.@Scale)));
}
WriteElementString(@"SqlDbType", @"",
Write8_SqlDbType(((global::System.Data.SqlDbType)o.@SqlDbType)));
Write1_Object(@"SqlValue", @"",
((global::System.Object)o.@SqlValue), false, false);
WriteElementString(@"UdtTypeName", @"",
((global::System.String)o.@UdtTypeName));
WriteElementStringRaw(@"Offset", @"",
System.Xml.XmlConvert.ToString((global::System.Int32)((global::System.Int32)o.@Offset)));
WriteEndElement(o);
}
void Write1_Object(string n, string ns, global::System.Object o,
bool isNullable, bool needType) {
if ((object)o == null) {
if (isNullable) WriteNullTagLiteral(n, ns);
return;
}
if (!needType) {
System.Type t = o.GetType();
if (t == typeof(global::System.Object)) {
}
else if (t == typeof(global::System.MarshalByRefObject)) {
Write2_MarshalByRefObject(n,
ns,(global::System.MarshalByRefObject)o, isNullable, true);
return;
}
else if (t ==
typeof(global::System.Data.Common.DbParameter)) {
Write6_DbParameter(n,
ns,(global::System.Data.Common.DbParameter)o, isNullable, true);
return;
}
else if (t ==
typeof(global::System.Data.SqlClient.SqlParameter)) {
Write9_SqlParameter(n,
ns,(global::System.Data.SqlClient.SqlParameter)o, isNullable, true);
return;
}
else if (t == typeof(global::System.Data.DbType)) {
Writer.WriteStartElement(n, ns);
WriteXsiType(@"DbType", @"");
Writer.WriteString(Write3_DbType((global::System.Data.DbType)o));
Writer.WriteEndElement();
return;
}
else if (t ==
typeof(global::System.Data.ParameterDirection)) {
Writer.WriteStartElement(n, ns);
WriteXsiType(@"ParameterDirection", @"");
Writer.WriteString(Write4_ParameterDirection((global::System.Data.ParameterDirection)o));
Writer.WriteEndElement();
return;
}
else if (t == typeof(global::System.Data.DataRowVersion)) {
Writer.WriteStartElement(n, ns);
WriteXsiType(@"DataRowVersion", @"");
Writer.WriteString(Write5_DataRowVersion((global::System.Data.DataRowVersion)o));
Writer.WriteEndElement();
return;
}
else if (t ==
typeof(global::System.Data.SqlTypes.SqlCompareOptions)) {
Writer.WriteStartElement(n, ns);
WriteXsiType(@"SqlCompareOptions", @"");
Writer.WriteString(Write7_SqlCompareOptions((global::System.Data.SqlTypes.SqlCompareOptions)o));
Writer.WriteEndElement();
return;
}
else if (t == typeof(global::System.Data.SqlDbType)) {
Writer.WriteStartElement(n, ns);
WriteXsiType(@"SqlDbType", @"");
Writer.WriteString(Write8_SqlDbType((global::System.Data.SqlDbType)o));
Writer.WriteEndElement();
return;
}
else {
WriteTypedPrimitive(n, ns, o, true);
return;
}
}
WriteStartElement(n, ns, o, false, null);
WriteEndElement(o);
}
string Write8_SqlDbType(global::System.Data.SqlDbType v) {
string s = null;
switch (v) {
case global::System.Data.SqlDbType.@BigInt: s = @"BigInt";
break;
case global::System.Data.SqlDbType.@Binary: s = @"Binary";
break;
case global::System.Data.SqlDbType.@Bit: s = @"Bit"; break;
case global::System.Data.SqlDbType.@Char: s = @"Char";
break;
case global::System.Data.SqlDbType.@DateTime: s =
@"DateTime"; break;
case global::System.Data.SqlDbType.@Decimal: s = @"Decimal";
break;
case global::System.Data.SqlDbType.@Float: s = @"Float";
break;
case global::System.Data.SqlDbType.@Image: s = @"Image";
break;
case global::System.Data.SqlDbType.@Int: s = @"Int"; break;
case global::System.Data.SqlDbType.@Money: s = @"Money";
break;
case global::System.Data.SqlDbType.@NChar: s = @"NChar";
break;
case global::System.Data.SqlDbType.@NText: s = @"NText";
break;
case global::System.Data.SqlDbType.@NVarChar: s =
@"NVarChar"; break;
case global::System.Data.SqlDbType.@Real: s = @"Real";
break;
case global::System.Data.SqlDbType.@UniqueIdentifier: s =
@"UniqueIdentifier"; break;
case global::System.Data.SqlDbType.@SmallDateTime: s =
@"SmallDateTime"; break;
case global::System.Data.SqlDbType.@SmallInt: s =
@"SmallInt"; break;
case global::System.Data.SqlDbType.@SmallMoney: s =
@"SmallMoney"; break;
case global::System.Data.SqlDbType.@Text: s = @"Text";
break;
case global::System.Data.SqlDbType.@Timestamp: s =
@"Timestamp"; break;
case global::System.Data.SqlDbType.@TinyInt: s = @"TinyInt";
break;
case global::System.Data.SqlDbType.@VarBinary: s =
@"VarBinary"; break;
case global::System.Data.SqlDbType.@VarChar: s = @"VarChar";
break;
case global::System.Data.SqlDbType.@Variant: s = @"Variant";
break;
case global::System.Data.SqlDbType.@Xml: s = @"Xml"; break;
case global::System.Data.SqlDbType.@Udt: s = @"Udt"; break;
default: throw
CreateInvalidEnumValueException(((System.Int64)v).ToString(System.Globalization.CultureInfo.InvariantCulture),
@"System.Data.SqlDbType");
}
return s;
}
string
Write7_SqlCompareOptions(global::System.Data.SqlTypes.SqlCompareOptions v) {
string s = null;
switch (v) {
case global::System.Data.SqlTypes.SqlCompareOptions.@None: s
= @"None"; break;
case
global::System.Data.SqlTypes.SqlCompareOptions.@IgnoreCase: s =
@"IgnoreCase"; break;
case
global::System.Data.SqlTypes.SqlCompareOptions.@IgnoreNonSpace: s =
@"IgnoreNonSpace"; break;
case
global::System.Data.SqlTypes.SqlCompareOptions.@IgnoreKanaType: s =
@"IgnoreKanaType"; break;
case
global::System.Data.SqlTypes.SqlCompareOptions.@IgnoreWidth: s =
@"IgnoreWidth"; break;
case
global::System.Data.SqlTypes.SqlCompareOptions.@BinarySort: s =
@"BinarySort"; break;
case
global::System.Data.SqlTypes.SqlCompareOptions.@BinarySort2: s =
@"BinarySort2"; break;
default: s = FromEnum(((System.Int64)v), new string[]
{@"None",
@"IgnoreCase",
@"IgnoreNonSpace",
@"IgnoreKanaType",
@"IgnoreWidth",
@"BinarySort",
@"BinarySort2"}, new System.Int64[]
{(long)global::System.Data.SqlTypes.SqlCompareOptions.@None,
(long)global::System.Data.SqlTypes.SqlCompareOptions.@IgnoreCase,
(long)global::System.Data.SqlTypes.SqlCompareOptions.@IgnoreNonSpace,
(long)global::System.Data.SqlTypes.SqlCompareOptions.@IgnoreKanaType,
(long)global::System.Data.SqlTypes.SqlCompareOptions.@IgnoreWidth,
(long)global::System.Data.SqlTypes.SqlCompareOptions.@BinarySort,
(long)global::System.Data.SqlTypes.SqlCompareOptions.@BinarySort2},
@"System.Data.SqlTypes.SqlCompareOptions"); break;
}
return s;
}
string Write5_DataRowVersion(global::System.Data.DataRowVersion v) {
string s = null;
switch (v) {
case global::System.Data.DataRowVersion.@Original: s =
@"Original"; break;
case global::System.Data.DataRowVersion.@Current: s =
@"Current"; break;
case global::System.Data.DataRowVersion.@Proposed: s =
@"Proposed"; break;
case global::System.Data.DataRowVersion.@Default: s =
@"Default"; break;
default: throw
CreateInvalidEnumValueException(((System.Int64)v).ToString(System.Globalization.CultureInfo.InvariantCulture),
@"System.Data.DataRowVersion");
}
return s;
}
string
Write4_ParameterDirection(global::System.Data.ParameterDirection v) {
string s = null;
switch (v) {
case global::System.Data.ParameterDirection.@Input: s =
@"Input"; break;
case global::System.Data.ParameterDirection.@Output: s =
@"Output"; break;
case global::System.Data.ParameterDirection.@InputOutput: s
= @"InputOutput"; break;
case global::System.Data.ParameterDirection.@ReturnValue: s
= @"ReturnValue"; break;
default: throw
CreateInvalidEnumValueException(((System.Int64)v).ToString(System.Globalization.CultureInfo.InvariantCulture),
@"System.Data.ParameterDirection");
}
return s;
}
string Write3_DbType(global::System.Data.DbType v) {
string s = null;
switch (v) {
case global::System.Data.DbType.@AnsiString: s =
@"AnsiString"; break;
case global::System.Data.DbType.@Binary: s = @"Binary";
break;
case global::System.Data.DbType.@Byte: s = @"Byte"; break;
case global::System.Data.DbType.@Boolean: s = @"Boolean";
break;
case global::System.Data.DbType.@Currency: s = @"Currency";
break;
case global::System.Data.DbType.@Date: s = @"Date"; break;
case global::System.Data.DbType.@DateTime: s = @"DateTime";
break;
case global::System.Data.DbType.@Decimal: s = @"Decimal";
break;
case global::System.Data.DbType.@Double: s = @"Double";
break;
case global::System.Data.DbType.@Guid: s = @"Guid"; break;
case global::System.Data.DbType.@Int16: s = @"Int16"; break;
case global::System.Data.DbType.@Int32: s = @"Int32"; break;
case global::System.Data.DbType.@Int64: s = @"Int64"; break;
case global::System.Data.DbType.@Object: s = @"Object";
break;
case global::System.Data.DbType.@SByte: s = @"SByte"; break;
case global::System.Data.DbType.@Single: s = @"Single";
break;
case global::System.Data.DbType.@String: s = @"String";
break;
case global::System.Data.DbType.@Time: s = @"Time"; break;
case global::System.Data.DbType.@UInt16: s = @"UInt16";
break;
case global::System.Data.DbType.@UInt32: s = @"UInt32";
break;
case global::System.Data.DbType.@UInt64: s = @"UInt64";
break;
case global::System.Data.DbType.@VarNumeric: s =
@"VarNumeric"; break;
case global::System.Data.DbType.@AnsiStringFixedLength: s =
@"AnsiStringFixedLength"; break;
case global::System.Data.DbType.@StringFixedLength: s =
@"StringFixedLength"; break;
case global::System.Data.DbType.@Xml: s = @"Xml"; break;
default: throw
CreateInvalidEnumValueException(((System.Int64)v).ToString(System.Globalization.CultureInfo.InvariantCulture),
@"System.Data.DbType");
}
return s;
}
void Write6_DbParameter(string n, string ns,
global::System.Data.Common.DbParameter o, bool isNullable, bool needType) {
if ((object)o == null) {
if (isNullable) WriteNullTagLiteral(n, ns);
return;
}
if (!needType) {
System.Type t = o.GetType();
if (t == typeof(global::System.Data.Common.DbParameter)) {
}
else if (t ==
typeof(global::System.Data.SqlClient.SqlParameter)) {
Write9_SqlParameter(n,
ns,(global::System.Data.SqlClient.SqlParameter)o, isNullable, true);
return;
}
else {
throw CreateUnknownTypeException(o);
}
}
}
void Write2_MarshalByRefObject(string n, string ns,
global::System.MarshalByRefObject o, bool isNullable, bool needType) {
if ((object)o == null) {
if (isNullable) WriteNullTagLiteral(n, ns);
return;
}
if (!needType) {
System.Type t = o.GetType();
if (t == typeof(global::System.MarshalByRefObject)) {
}
else if (t ==
typeof(global::System.Data.Common.DbParameter)) {
Write6_DbParameter(n,
ns,(global::System.Data.Common.DbParameter)o, isNullable, true);
return;
}
else if (t ==
typeof(global::System.Data.SqlClient.SqlParameter)) {
Write9_SqlParameter(n,
ns,(global::System.Data.SqlClient.SqlParameter)o, isNullable, true);
return;
}
else {
throw CreateUnknownTypeException(o);
}
}
}
protected override void InitCallbacks() {
}
}
public class XmlSerializationReaderSqlParameter :
System.Xml.Serialization.XmlSerializationReader {
public object Read10_SqlParameter() {
object o = null;
Reader.MoveToContent();
if (Reader.NodeType == System.Xml.XmlNodeType.Element) {
if (((object) Reader.LocalName == (object)id1_SqlParameter
&& (object) Reader.NamespaceURI == (object)id2_Item)) {
o = Read9_SqlParameter(true, true);
}
else {
throw CreateUnknownNodeException();
}
}
else {
UnknownNode(null, @":SqlParameter");
}
return (object)o;
}
global::System.Data.SqlClient.SqlParameter Read9_SqlParameter(bool
isNullable, bool checkType) {
System.Xml.XmlQualifiedName xsiType = checkType ? GetXsiType() :
null;
bool isNull = false;
if (isNullable) isNull = ReadNull();
if (checkType) {
if (xsiType == null || ((object)
((System.Xml.XmlQualifiedName)xsiType).Name == (object)id1_SqlParameter &&
(object) ((System.Xml.XmlQualifiedName)xsiType).Namespace ==
(object)id2_Item)) {
}
else
throw
CreateUnknownTypeException((System.Xml.XmlQualifiedName)xsiType);
}
if (isNull) return null;
global::System.Data.SqlClient.SqlParameter o;
o = new global::System.Data.SqlClient.SqlParameter();
bool[] paramsRead = new bool[20];
while (Reader.MoveToNextAttribute()) {
if (!IsXmlnsAttribute(Reader.Name)) {
UnknownNode((object)o);
}
}
Reader.MoveToElement();
if (Reader.IsEmptyElement) {
Reader.Skip();
return o;
}
Reader.ReadStartElement();
Reader.MoveToContent();
int whileIterations0 = 0;
int readerCount0 = ReaderCount;
while (Reader.NodeType != System.Xml.XmlNodeType.EndElement &&
Reader.NodeType != System.Xml.XmlNodeType.None) {
if (Reader.NodeType == System.Xml.XmlNodeType.Element) {
if (!paramsRead[0] && ((object) Reader.LocalName ==
(object)id3_DbType && (object) Reader.NamespaceURI == (object)id2_Item)) {
{
o.@DbType =
Read3_DbType(Reader.ReadElementString());
}
paramsRead[0] = true;
}
else if (!paramsRead[1] && ((object) Reader.LocalName ==
(object)id4_Direction && (object) Reader.NamespaceURI == (object)id2_Item))
{
if (Reader.IsEmptyElement) {
Reader.Skip();
}
else {
o.@Direction =
Read4_ParameterDirection(Reader.ReadElementString());
}
paramsRead[1] = true;
}
else if (!paramsRead[2] && ((object) Reader.LocalName ==
(object)id5_IsNullable && (object) Reader.NamespaceURI == (object)id2_Item))
{
{
o.@IsNullable =
System.Xml.XmlConvert.ToBoolean(Reader.ReadElementString());
}
paramsRead[2] = true;
}
else if (!paramsRead[3] && ((object) Reader.LocalName ==
(object)id6_ParameterName && (object) Reader.NamespaceURI ==
(object)id2_Item)) {
{
o.@ParameterName = Reader.ReadElementString();
}
paramsRead[3] = true;
}
else if (!paramsRead[4] && ((object) Reader.LocalName ==
(object)id7_Size && (object) Reader.NamespaceURI == (object)id2_Item)) {
{
o.@Size =
System.Xml.XmlConvert.ToInt32(Reader.ReadElementString());
}
paramsRead[4] = true;
}
else if (!paramsRead[5] && ((object) Reader.LocalName ==
(object)id8_SourceColumn && (object) Reader.NamespaceURI ==
(object)id2_Item)) {
{
o.@SourceColumn = Reader.ReadElementString();
}
paramsRead[5] = true;
}
else if (!paramsRead[6] && ((object) Reader.LocalName ==
(object)id9_SourceColumnNullMapping && (object) Reader.NamespaceURI ==
(object)id2_Item)) {
if (Reader.IsEmptyElement) {
Reader.Skip();
}
else {
o.@SourceColumnNullMapping =
System.Xml.XmlConvert.ToBoolean(Reader.ReadElementString());
}
paramsRead[6] = true;
}
else if (!paramsRead[7] && ((object) Reader.LocalName ==
(object)id10_SourceVersion && (object) Reader.NamespaceURI ==
(object)id2_Item)) {
if (Reader.IsEmptyElement) {
Reader.Skip();
}
else {
o.@SourceVersion =
Read5_DataRowVersion(Reader.ReadElementString());
}
paramsRead[7] = true;
}
else if (!paramsRead[8] && ((object) Reader.LocalName ==
(object)id11_Value && (object) Reader.NamespaceURI == (object)id2_Item)) {
o.@Value = Read1_Object(false, true);
paramsRead[8] = true;
}
else if (!paramsRead[9] && ((object) Reader.LocalName ==
(object)id12_CompareInfo && (object) Reader.NamespaceURI ==
(object)id2_Item)) {
{
o.@CompareInfo =
Read7_SqlCompareOptions(Reader.ReadElementString());
}
paramsRead[9] = true;
}
else if (!paramsRead[10] && ((object) Reader.LocalName
== (object)id13_XmlSchemaCollectionDatabase && (object) Reader.NamespaceURI
== (object)id2_Item)) {
{
o.@XmlSchemaCollectionDatabase =
Reader.ReadElementString();
}
paramsRead[10] = true;
}
else if (!paramsRead[11] && ((object) Reader.LocalName
== (object)id14_Item && (object) Reader.NamespaceURI == (object)id2_Item)) {
{
o.@XmlSchemaCollectionOwningSchema =
Reader.ReadElementString();
}
paramsRead[11] = true;
}
else if (!paramsRead[12] && ((object) Reader.LocalName
== (object)id15_XmlSchemaCollectionName && (object) Reader.NamespaceURI ==
(object)id2_Item)) {
{
o.@XmlSchemaCollectionName =
Reader.ReadElementString();
}
paramsRead[12] = true;
}
else if (!paramsRead[13] && ((object) Reader.LocalName
== (object)id16_LocaleId && (object) Reader.NamespaceURI ==
(object)id2_Item)) {
{
o.@LocaleId =
System.Xml.XmlConvert.ToInt32(Reader.ReadElementString());
}
paramsRead[13] = true;
}
else if (!paramsRead[14] && ((object) Reader.LocalName
== (object)id17_Precision && (object) Reader.NamespaceURI ==
(object)id2_Item)) {
if (Reader.IsEmptyElement) {
Reader.Skip();
}
else {
o.@Precision =
System.Xml.XmlConvert.ToByte(Reader.ReadElementString());
}
paramsRead[14] = true;
}
else if (!paramsRead[15] && ((object) Reader.LocalName
== (object)id18_Scale && (object) Reader.NamespaceURI == (object)id2_Item))
{
if (Reader.IsEmptyElement) {
Reader.Skip();
}
else {
o.@Scale =
System.Xml.XmlConvert.ToByte(Reader.ReadElementString());
}
paramsRead[15] = true;
}
else if (!paramsRead[16] && ((object) Reader.LocalName
== (object)id19_SqlDbType && (object) Reader.NamespaceURI ==
(object)id2_Item)) {
{
o.@SqlDbType =
Read8_SqlDbType(Reader.ReadElementString());
}
paramsRead[16] = true;
}
else if (!paramsRead[17] && ((object) Reader.LocalName
== (object)id20_SqlValue && (object) Reader.NamespaceURI ==
(object)id2_Item)) {
o.@SqlValue = Read1_Object(false, true);
paramsRead[17] = true;
}
else if (!paramsRead[18] && ((object) Reader.LocalName
== (object)id21_UdtTypeName && (object) Reader.NamespaceURI ==
(object)id2_Item)) {
{
o.@UdtTypeName = Reader.ReadElementString();
}
paramsRead[18] = true;
}
else if (!paramsRead[19] && ((object) Reader.LocalName
== (object)id22_Offset && (object) Reader.NamespaceURI == (object)id2_Item))
{
{
o.@Offset =
System.Xml.XmlConvert.ToInt32(Reader.ReadElementString());
}
paramsRead[19] = true;
}
else {
UnknownNode((object)o, @"
bType,
irection,
:IsNullable,
arameterName, :Size, :SourceColumn, :SourceColumnNullMapping,
:SourceVersion, :Value, :CompareInfo, :XmlSchemaCollectionDatabase,
:XmlSchemaCollectionOwningSchema, :XmlSchemaCollectionName, :LocaleId,
recision, :Scale, :SqlDbType, :SqlValue, :UdtTypeName, :Offset");
}
}
else {
UnknownNode((object)o, @"
bType,
irection,
:IsNullable,
arameterName, :Size, :SourceColumn, :SourceColumnNullMapping,
:SourceVersion, :Value, :CompareInfo, :XmlSchemaCollectionDatabase,
:XmlSchemaCollectionOwningSchema, :XmlSchemaCollectionName, :LocaleId,
recision, :Scale, :SqlDbType, :SqlValue, :UdtTypeName, :Offset");
}
Reader.MoveToContent();
CheckReaderCount(ref whileIterations0, ref readerCount0);
}
ReadEndElement();
return o;
}
global::System.Object Read1_Object(bool isNullable, bool checkType)
{
System.Xml.XmlQualifiedName xsiType = checkType ? GetXsiType() :
null;
bool isNull = false;
if (isNullable) isNull = ReadNull();
if (checkType) {
if (isNull) {
if (xsiType != null) return
(global::System.Object)ReadTypedNull(xsiType);
else return null;
}
if (xsiType == null) {
return ReadTypedPrimitive(new
System.Xml.XmlQualifiedName("anyType", "
http://www.w3.org/2001/XMLSchema"));
}
else if (((object)
((System.Xml.XmlQualifiedName)xsiType).Name ==
(object)id23_MarshalByRefObject && (object)
((System.Xml.XmlQualifiedName)xsiType).Namespace == (object)id2_Item))
return Read2_MarshalByRefObject(isNullable, false);
else if (((object)
((System.Xml.XmlQualifiedName)xsiType).Name == (object)id24_DbParameter &&
(object) ((System.Xml.XmlQualifiedName)xsiType).Namespace ==
(object)id2_Item))
return Read6_DbParameter(isNullable, false);
else if (((object)
((System.Xml.XmlQualifiedName)xsiType).Name == (object)id1_SqlParameter &&
(object) ((System.Xml.XmlQualifiedName)xsiType).Namespace ==
(object)id2_Item))
return Read9_SqlParameter(isNullable, false);
else if (((object)
((System.Xml.XmlQualifiedName)xsiType).Name == (object)id3_DbType &&
(object) ((System.Xml.XmlQualifiedName)xsiType).Namespace ==
(object)id2_Item)) {
Reader.ReadStartElement();
object e =
Read3_DbType(CollapseWhitespace(Reader.ReadString()));
ReadEndElement();
return e;
}
else if (((object)
((System.Xml.XmlQualifiedName)xsiType).Name ==
(object)id25_ParameterDirection && (object)
((System.Xml.XmlQualifiedName)xsiType).Namespace == (object)id2_Item)) {
Reader.ReadStartElement();
object e =
Read4_ParameterDirection(CollapseWhitespace(Reader.ReadString()));
ReadEndElement();
return e;
}
else if (((object)
((System.Xml.XmlQualifiedName)xsiType).Name == (object)id26_DataRowVersion
&& (object) ((System.Xml.XmlQualifiedName)xsiType).Namespace ==
(object)id2_Item)) {
Reader.ReadStartElement();
object e =
Read5_DataRowVersion(CollapseWhitespace(Reader.ReadString()));
ReadEndElement();
return e;
}
else if (((object)
((System.Xml.XmlQualifiedName)xsiType).Name ==
(object)id27_SqlCompareOptions && (object)
((System.Xml.XmlQualifiedName)xsiType).Namespace == (object)id2_Item)) {
Reader.ReadStartElement();
object e =
Read7_SqlCompareOptions(CollapseWhitespace(Reader.ReadString()));
ReadEndElement();
return e;
}
else if (((object)
((System.Xml.XmlQualifiedName)xsiType).Name == (object)id19_SqlDbType &&
(object) ((System.Xml.XmlQualifiedName)xsiType).Namespace ==
(object)id2_Item)) {
Reader.ReadStartElement();
object e =
Read8_SqlDbType(CollapseWhitespace(Reader.ReadString()));
ReadEndElement();
return e;
}
else
return
ReadTypedPrimitive((System.Xml.XmlQualifiedName)xsiType);
}
if (isNull) return null;
global::System.Object o;
o = new global::System.Object();
bool[] paramsRead = new bool[0];
while (Reader.MoveToNextAttribute()) {
if (!IsXmlnsAttribute(Reader.Name)) {
UnknownNode((object)o);
}
}
Reader.MoveToElement();
if (Reader.IsEmptyElement) {
Reader.Skip();
return o;
}
Reader.ReadStartElement();
Reader.MoveToContent();
int whileIterations1 = 0;
int readerCount1 = ReaderCount;
while (Reader.NodeType != System.Xml.XmlNodeType.EndElement
&& Reader.NodeType != System.Xml.XmlNodeType.None) {
if (Reader.NodeType == System.Xml.XmlNodeType.Element) {
UnknownNode((object)o, @"");
}
else {
UnknownNode((object)o, @"");
}
Reader.MoveToContent();
CheckReaderCount(ref whileIterations1, ref
readerCount1);
}
ReadEndElement();
return o;
}
global::System.Data.SqlDbType Read8_SqlDbType(string s) {
switch (s) {
case @"BigInt": return
global::System.Data.SqlDbType.@BigInt;
case @"Binary": return
global::System.Data.SqlDbType.@Binary;
case @"Bit": return global::System.Data.SqlDbType.@Bit;
case @"Char": return
global::System.Data.SqlDbType.@Char;
case @"DateTime": return
global::System.Data.SqlDbType.@DateTime;
case @"Decimal": return
global::System.Data.SqlDbType.@Decimal;
case @"Float": return
global::System.Data.SqlDbType.@Float;
case @"Image": return
global::System.Data.SqlDbType.@Image;
case @"Int": return global::System.Data.SqlDbType.@Int;
case @"Money": return
global::System.Data.SqlDbType.@Money;
case @"NChar": return
global::System.Data.SqlDbType.@NChar;
case @"NText": return
global::System.Data.SqlDbType.@NText;
case @"NVarChar": return
global::System.Data.SqlDbType.@NVarChar;
case @"Real": return
global::System.Data.SqlDbType.@Real;
case @"UniqueIdentifier": return
global::System.Data.SqlDbType.@UniqueIdentifier;
case @"SmallDateTime": return
global::System.Data.SqlDbType.@SmallDateTime;
case @"SmallInt": return
global::System.Data.SqlDbType.@SmallInt;
case @"SmallMoney": return
global::System.Data.SqlDbType.@SmallMoney;
case @"Text": return
global::System.Data.SqlDbType.@Text;
case @"Timestamp": return
global::System.Data.SqlDbType.@Timestamp;
case @"TinyInt": return
global::System.Data.SqlDbType.@TinyInt;
case @"VarBinary": return
global::System.Data.SqlDbType.@VarBinary;
case @"VarChar": return
global::System.Data.SqlDbType.@VarChar;
case @"Variant": return
global::System.Data.SqlDbType.@Variant;
case @"Xml": return global::System.Data.SqlDbType.@Xml;
case @"Udt": return global::System.Data.SqlDbType.@Udt;
default: throw CreateUnknownConstantException(s,
typeof(global::System.Data.SqlDbType));
}
}
System.Collections.Hashtable _SqlCompareOptionsValues;
internal System.Collections.Hashtable SqlCompareOptionsValues {
get {
if ((object)_SqlCompareOptionsValues == null) {
System.Collections.Hashtable h = new
System.Collections.Hashtable();
h.Add(@"None",
(long)global::System.Data.SqlTypes.SqlCompareOptions.@None);
h.Add(@"IgnoreCase",
(long)global::System.Data.SqlTypes.SqlCompareOptions.@IgnoreCase);
h.Add(@"IgnoreNonSpace",
(long)global::System.Data.SqlTypes.SqlCompareOptions.@IgnoreNonSpace);
h.Add(@"IgnoreKanaType",
(long)global::System.Data.SqlTypes.SqlCompareOptions.@IgnoreKanaType);
h.Add(@"IgnoreWidth",
(long)global::System.Data.SqlTypes.SqlCompareOptions.@IgnoreWidth);
h.Add(@"BinarySort",
(long)global::System.Data.SqlTypes.SqlCompareOptions.@BinarySort);
h.Add(@"BinarySort2",
(long)global::System.Data.SqlTypes.SqlCompareOptions.@BinarySort2);
_SqlCompareOptionsValues = h;
}
return _SqlCompareOptionsValues;
}
}
global::System.Data.SqlTypes.SqlCompareOptions
Read7_SqlCompareOptions(string s) {
return
(global::System.Data.SqlTypes.SqlCompareOptions)ToEnum(s,
SqlCompareOptionsValues, @"global::System.Data.SqlTypes.SqlCompareOptions");
}
global::System.Data.DataRowVersion Read5_DataRowVersion(string
s) {
switch (s) {
case @"Original": return
global::System.Data.DataRowVersion.@Original;
case @"Current": return
global::System.Data.DataRowVersion.@Current;
case @"Proposed": return
global::System.Data.DataRowVersion.@Proposed;
case @"Default": return
global::System.Data.DataRowVersion.@Default;
default: throw CreateUnknownConstantException(s,
typeof(global::System.Data.DataRowVersion));
}
}
global::System.Data.ParameterDirection
Read4_ParameterDirection(string s) {
switch (s) {
case @"Input": return
global::System.Data.ParameterDirection.@Input;
case @"Output": return
global::System.Data.ParameterDirection.@Output;
case @"InputOutput": return
global::System.Data.ParameterDirection.@InputOutput;
case @"ReturnValue": return
global::System.Data.ParameterDirection.@ReturnValue;
default: throw CreateUnknownConstantException(s,
typeof(global::System.Data.ParameterDirection));
}
}
global::System.Data.DbType Read3_DbType(string s) {
switch (s) {
case @"AnsiString": return
global::System.Data.DbType.@AnsiString;
case @"Binary": return
global::System.Data.DbType.@Binary;
case @"Byte": return global::System.Data.DbType.@Byte;
case @"Boolean": return
global::System.Data.DbType.@Boolean;
case @"Currency": return
global::System.Data.DbType.@Currency;
case @"Date": return global::System.Data.DbType.@Date;
case @"DateTime": return
global::System.Data.DbType.@DateTime;
case @"Decimal": return
global::System.Data.DbType.@Decimal;
case @"Double": return
global::System.Data.DbType.@Double;
case @"Guid": return global::System.Data.DbType.@Guid;
case @"Int16": return global::System.Data.DbType.@Int16;
case @"Int32": return global::System.Data.DbType.@Int32;
case @"Int64": return global::System.Data.DbType.@Int64;
case @"Object": return
global::System.Data.DbType.@Object;
case @"SByte": return global::System.Data.DbType.@SByte;
case @"Single": return
global::System.Data.DbType.@Single;
case @"String": return
global::System.Data.DbType.@String;
case @"Time": return global::System.Data.DbType.@Time;
case @"UInt16": return
global::System.Data.DbType.@UInt16;
case @"UInt32": return
global::System.Data.DbType.@UInt32;
case @"UInt64": return
global::System.Data.DbType.@UInt64;
case @"VarNumeric": return
global::System.Data.DbType.@VarNumeric;
case @"AnsiStringFixedLength": return
global::System.Data.DbType.@AnsiStringFixedLength;
case @"StringFixedLength": return
global::System.Data.DbType.@StringFixedLength;
case @"Xml": return global::System.Data.DbType.@Xml;
default: throw CreateUnknownConstantException(s,
typeof(global::System.Data.DbType));
}
}
global::System.Data.Common.DbParameter Read6_DbParameter(bool
isNullable, bool checkType) {
System.Xml.XmlQualifiedName xsiType = checkType ?
GetXsiType() : null;
bool isNull = false;
if (isNullable) isNull = ReadNull();
if (checkType) {
if (xsiType == null || ((object)
((System.Xml.XmlQualifiedName)xsiType).Name == (object)id24_DbParameter &&
(object) ((System.Xml.XmlQualifiedName)xsiType).Namespace ==
(object)id2_Item)) {
}
else if (((object)
((System.Xml.XmlQualifiedName)xsiType).Name == (object)id1_SqlParameter &&
(object) ((System.Xml.XmlQualifiedName)xsiType).Namespace ==
(object)id2_Item))
return Read9_SqlParameter(isNullable, false);
else
throw
CreateUnknownTypeException((System.Xml.XmlQualifiedName)xsiType);
}
if (isNull) return null;
throw CreateAbstractTypeException(@"DbParameter", @"");
}
global::System.MarshalByRefObject Read2_MarshalByRefObject(bool
isNullable, bool checkType) {
System.Xml.XmlQualifiedName xsiType = checkType ?
GetXsiType() : null;
bool isNull = false;
if (isNullable) isNull = ReadNull();
if (checkType) {
if (xsiType == null || ((object)
((System.Xml.XmlQualifiedName)xsiType).Name ==
(object)id23_MarshalByRefObject && (object)
((System.Xml.XmlQualifiedName)xsiType).Namespace == (object)id2_Item)) {
}
else if (((object)
((System.Xml.XmlQualifiedName)xsiType).Name == (object)id24_DbParameter &&
(object) ((System.Xml.XmlQualifiedName)xsiType).Namespace ==
(object)id2_Item))
return Read6_DbParameter(isNullable, false);
else if (((object)
((System.Xml.XmlQualifiedName)xsiType).Name == (object)id1_SqlParameter &&
(object) ((System.Xml.XmlQualifiedName)xsiType).Namespace ==
(object)id2_Item))
return Read9_SqlParameter(isNullable, false);
else
throw
CreateUnknownTypeException((System.Xml.XmlQualifiedName)xsiType);
}
if (isNull) return null;
throw CreateAbstractTypeException(@"MarshalByRefObject",
@"");
}
protected override void InitCallbacks() {
}
string id14_Item;
string id5_IsNullable;
string id20_SqlValue;
string id27_SqlCompareOptions;
string id4_Direction;
string id8_SourceColumn;
string id6_ParameterName;
string id18_Scale;
string id26_DataRowVersion;
string id25_ParameterDirection;
string id11_Value;
string id19_SqlDbType;
string id2_Item;
string id10_SourceVersion;
string id21_UdtTypeName;
string id12_CompareInfo;
string id13_XmlSchemaCollectionDatabase;
string id1_SqlParameter;
string id16_LocaleId;
string id7_Size;
string id23_MarshalByRefObject;
string id9_SourceColumnNullMapping;
string id15_XmlSchemaCollectionName;
string id22_Offset;
string id17_Precision;
string id3_DbType;
string id24_DbParameter;
protected override void InitIDs() {
id14_Item =
Reader.NameTable.Add(@"XmlSchemaCollectionOwningSchema");
id5_IsNullable = Reader.NameTable.Add(@"IsNullable");
id20_SqlValue = Reader.NameTable.Add(@"SqlValue");
id27_SqlCompareOptions =
Reader.NameTable.Add(@"SqlCompareOptions");
id4_Direction = Reader.NameTable.Add(@"Direction");
id8_SourceColumn = Reader.NameTable.Add(@"SourceColumn");
id6_ParameterName = Reader.NameTable.Add(@"ParameterName");
id18_Scale = Reader.NameTable.Add(@"Scale");
id26_DataRowVersion =
Reader.NameTable.Add(@"DataRowVersion");
id25_ParameterDirection =
Reader.NameTable.Add(@"ParameterDirection");
id11_Value = Reader.NameTable.Add(@"Value");
id19_SqlDbType = Reader.NameTable.Add(@"SqlDbType");
id2_Item = Reader.NameTable.Add(@"");
id10_SourceVersion = Reader.NameTable.Add(@"SourceVersion");
id21_UdtTypeName = Reader.NameTable.Add(@"UdtTypeName");
id12_CompareInfo = Reader.NameTable.Add(@"CompareInfo");
id13_XmlSchemaCollectionDatabase =
Reader.NameTable.Add(@"XmlSchemaCollectionDatabase");
id1_SqlParameter = Reader.NameTable.Add(@"SqlParameter");
id16_LocaleId = Reader.NameTable.Add(@"LocaleId");
id7_Size = Reader.NameTable.Add(@"Size");
id23_MarshalByRefObject =
Reader.NameTable.Add(@"MarshalByRefObject");
id9_SourceColumnNullMapping =
Reader.NameTable.Add(@"SourceColumnNullMapping");
id15_XmlSchemaCollectionName =
Reader.NameTable.Add(@"XmlSchemaCollectionName");
id22_Offset = Reader.NameTable.Add(@"Offset");
id17_Precision = Reader.NameTable.Add(@"Precision");
id3_DbType = Reader.NameTable.Add(@"DbType");
id24_DbParameter = Reader.NameTable.Add(@"DbParameter");
}
}
public abstract class XmlSerializer1 :
System.Xml.Serialization.XmlSerializer {
protected override
System.Xml.Serialization.XmlSerializationReader CreateReader() {
return new XmlSerializationReaderSqlParameter();
}
protected override
System.Xml.Serialization.XmlSerializationWriter CreateWriter() {
return new XmlSerializationWriterSqlParameter();
}
}
public sealed class SqlParameterSerializer : XmlSerializer1 {
public override System.Boolean
CanDeserialize(System.Xml.XmlReader xmlReader) {
return xmlReader.IsStartElement(@"SqlParameter", @"");
}
protected override void Serialize(object objectToSerialize,
System.Xml.Serialization.XmlSerializationWriter writer) {
((XmlSerializationWriterSqlParameter)writer).Write10_SqlParameter(objectToSerialize);
}
protected override object
Deserialize(System.Xml.Serialization.XmlSerializationReader reader) {
return
((XmlSerializationReaderSqlParameter)reader).Read10_SqlParameter();
}
}
public class XmlSerializerContract :
global::System.Xml.Serialization.XmlSerializerImplementation {
public override
global::System.Xml.Serialization.XmlSerializationReader Reader { get {
return new XmlSerializationReaderSqlParameter(); } }
public override
global::System.Xml.Serialization.XmlSerializationWriter Writer { get {
return new XmlSerializationWriterSqlParameter(); } }
System.Collections.Hashtable readMethods = null;
public override System.Collections.Hashtable ReadMethods {
get {
if (readMethods == null) {
System.Collections.Hashtable _tmp = new
System.Collections.Hashtable();
_tmp[@"System.Data.SqlClient.SqlParameter::"] =
@"Read10_SqlParameter";
if (readMethods == null) readMethods = _tmp;
}
return readMethods;
}
}
System.Collections.Hashtable writeMethods = null;
public override System.Collections.Hashtable WriteMethods {
get {
if (writeMethods == null) {
System.Collections.Hashtable _tmp = new
System.Collections.Hashtable();
_tmp[@"System.Data.SqlClient.SqlParameter::"] =
@"Write10_SqlParameter";
if (writeMethods == null) writeMethods = _tmp;
}
return writeMethods;
}
}
System.Collections.Hashtable typedSerializers = null;
public override System.Collections.Hashtable TypedSerializers {
get {
if (typedSerializers == null) {
System.Collections.Hashtable _tmp = new
System.Collections.Hashtable();
_tmp.Add(@"System.Data.SqlClient.SqlParameter::",
new SqlParameterSerializer());
if (typedSerializers == null) typedSerializers =
_tmp;
}
return typedSerializers;
}
}
public override System.Boolean CanSerialize(System.Type type) {
if (type ==
typeof(global::System.Data.SqlClient.SqlParameter)) return true;
return false;
}
public override System.Xml.Serialization.XmlSerializer
GetSerializer(System.Type type) {
if (type ==
typeof(global::System.Data.SqlClient.SqlParameter)) return new
SqlParameterSerializer();
return null;
}
}
}