DataSvcMapFileSerializer.cs source code in C# .NET

Source code for the .NET framework in C#

                        

Code:

/ Dotnetfx_Win7_3.5.1 / Dotnetfx_Win7_3.5.1 / 3.5.1 / DEVDIV / depot / DevDiv / releases / Orcas / NetFXw7 / ndp / fx / src / xsp / System / Web / Extensions / Compilation / XmlSerializer / DataSvcMapFileSerializer.cs / 1 / DataSvcMapFileSerializer.cs

                            //------------------------------------------------------------------------------ 
// 
//   Copyright (C) Microsoft Corporation. All Rights Reserved.
// 
//----------------------------------------------------------------------------- 

//  This file is generated. DO NOT MODIFY IT BY HAND. 
// Please read HowToUpdateSerializer.txt in the parent directory to see how to update it. 

 
namespace System.Web.Compilation.XmlSerializerDataSvc {

    internal class XmlSerializationWriterDataSvcMapFile : System.Xml.Serialization.XmlSerializationWriter {
 
        public void Write8_ReferenceGroup(object o) {
            WriteStartDocument(); 
            if (o == null) { 
                WriteNullTagLiteral(@"ReferenceGroup", @"urn:schemas-microsoft-com:xml-dataservicemap");
                return; 
            }
            TopLevelElement();
            Write7_DataSvcMapFile(@"ReferenceGroup", @"urn:schemas-microsoft-com:xml-dataservicemap", ((global::System.Web.Compilation.WCFModel.DataSvcMapFile)o), true, false);
        } 

        void Write7_DataSvcMapFile(string n, string ns, global::System.Web.Compilation.WCFModel.DataSvcMapFile 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.Web.Compilation.WCFModel.DataSvcMapFile)) { 
                }
                else { 
                    throw CreateUnknownTypeException(o); 
                }
            } 
            WriteStartElement(n, ns, o, false, null);
            if (needType) WriteXsiType(@"DataSvcMapFile", @"urn:schemas-microsoft-com:xml-dataservicemap");
            WriteAttribute(@"ID", @"", ((global::System.String)o.@ID));
            { 
                global::System.Collections.Generic.List a = (global::System.Collections.Generic.List)((global::System.Collections.Generic.List)o.@MetadataSourceList);
                if (a != null){ 
                    WriteStartElement(@"MetadataSources", @"urn:schemas-microsoft-com:xml-dataservicemap", null, false); 
                    for (int ia = 0; ia < ((System.Collections.ICollection)a).Count; ia++) {
                        Write6_MetadataSource(@"MetadataSource", @"urn:schemas-microsoft-com:xml-dataservicemap", ((global::System.Web.Compilation.WCFModel.MetadataSource)a[ia]), true, false); 
                    }
                    WriteEndElement();
                }
            } 
            {
                global::System.Collections.Generic.List a = (global::System.Collections.Generic.List)((global::System.Collections.Generic.List)o.@MetadataList); 
                if (a != null){ 
                    WriteStartElement(@"Metadata", @"urn:schemas-microsoft-com:xml-dataservicemap", null, false);
                    for (int ia = 0; ia < ((System.Collections.ICollection)a).Count; ia++) { 
                        Write5_MetadataFile(@"MetadataFile", @"urn:schemas-microsoft-com:xml-dataservicemap", ((global::System.Web.Compilation.WCFModel.MetadataFile)a[ia]), true, false);
                    }
                    WriteEndElement();
                } 
            }
            { 
                global::System.Collections.Generic.List a = (global::System.Collections.Generic.List)((global::System.Collections.Generic.List)o.@Extensions); 
                if (a != null){
                    WriteStartElement(@"Extensions", @"urn:schemas-microsoft-com:xml-dataservicemap", null, false); 
                    for (int ia = 0; ia < ((System.Collections.ICollection)a).Count; ia++) {
                        Write3_ExtensionFile(@"ExtensionFile", @"urn:schemas-microsoft-com:xml-dataservicemap", ((global::System.Web.Compilation.WCFModel.ExtensionFile)a[ia]), true, false);
                    }
                    WriteEndElement(); 
                }
            } 
            WriteEndElement(o); 
        }
 
        void Write3_ExtensionFile(string n, string ns, global::System.Web.Compilation.WCFModel.ExtensionFile 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.Web.Compilation.WCFModel.ExtensionFile)) {
                } 
                else {
                    throw CreateUnknownTypeException(o);
                }
            } 
            WriteStartElement(n, ns, o, false, null);
            if (needType) WriteXsiType(@"ExtensionFile", @"urn:schemas-microsoft-com:xml-dataservicemap"); 
            WriteAttribute(@"FileName", @"", ((global::System.String)o.@FileName)); 
            WriteAttribute(@"Name", @"", ((global::System.String)o.@Name));
            WriteEndElement(o); 
        }

        void Write5_MetadataFile(string n, string ns, global::System.Web.Compilation.WCFModel.MetadataFile 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.Web.Compilation.WCFModel.MetadataFile)) {
                }
                else {
                    throw CreateUnknownTypeException(o); 
                }
            } 
            WriteStartElement(n, ns, o, false, null); 
            if (needType) WriteXsiType(@"MetadataFile", @"urn:schemas-microsoft-com:xml-dataservicemap");
            WriteAttribute(@"FileName", @"", ((global::System.String)o.@FileName)); 
            WriteAttribute(@"MetadataType", @"", Write4_MetadataType(((global::System.Web.Compilation.WCFModel.MetadataFile.MetadataType)o.@FileType)));
            WriteAttribute(@"ID", @"", ((global::System.String)o.@ID));
            if (o.@IgnoreSpecified) {
                WriteAttribute(@"Ignore", @"", System.Xml.XmlConvert.ToString((global::System.Boolean)((global::System.Boolean)o.@Ignore))); 
            }
            if (o.@IsMergeResultSpecified) { 
                WriteAttribute(@"IsMergeResult", @"", System.Xml.XmlConvert.ToString((global::System.Boolean)((global::System.Boolean)o.@IsMergeResult))); 
            }
            if (o.@SourceIdSpecified) { 
                WriteAttribute(@"SourceId", @"", System.Xml.XmlConvert.ToString((global::System.Int32)((global::System.Int32)o.@SourceId)));
            }
            WriteAttribute(@"SourceUrl", @"", ((global::System.String)o.@SourceUrl));
            if (o.@IgnoreSpecified) { 
            }
            if (o.@IsMergeResultSpecified) { 
            } 
            if (o.@SourceIdSpecified) {
            } 
            WriteEndElement(o);
        }

        string Write4_MetadataType(global::System.Web.Compilation.WCFModel.MetadataFile.MetadataType v) { 
            string s = null;
            switch (v) { 
                case global::System.Web.Compilation.WCFModel.MetadataFile.MetadataType.@Unknown: s = @"Unknown"; break; 
                case global::System.Web.Compilation.WCFModel.MetadataFile.MetadataType.@Disco: s = @"Disco"; break;
                case global::System.Web.Compilation.WCFModel.MetadataFile.MetadataType.@Wsdl: s = @"Wsdl"; break; 
                case global::System.Web.Compilation.WCFModel.MetadataFile.MetadataType.@Schema: s = @"Schema"; break;
                case global::System.Web.Compilation.WCFModel.MetadataFile.MetadataType.@Policy: s = @"Policy"; break;
                case global::System.Web.Compilation.WCFModel.MetadataFile.MetadataType.@Xml: s = @"Xml"; break;
                case global::System.Web.Compilation.WCFModel.MetadataFile.MetadataType.@Edmx: s = @"Edmx"; break; 
                default: throw CreateInvalidEnumValueException(((System.Int64)v).ToString(System.Globalization.CultureInfo.InvariantCulture), @"System.Web.Compilation.WCFModel.MetadataFile.MetadataType");
            } 
            return s; 
        }
 
        void Write6_MetadataSource(string n, string ns, global::System.Web.Compilation.WCFModel.MetadataSource 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.Web.Compilation.WCFModel.MetadataSource)) {
                } 
                else {
                    throw CreateUnknownTypeException(o);
                }
            } 
            WriteStartElement(n, ns, o, false, null);
            if (needType) WriteXsiType(@"MetadataSource", @"urn:schemas-microsoft-com:xml-dataservicemap"); 
            WriteAttribute(@"Address", @"", ((global::System.String)o.@Address)); 
            WriteAttribute(@"Protocol", @"", ((global::System.String)o.@Protocol));
            WriteAttribute(@"SourceId", @"", System.Xml.XmlConvert.ToString((global::System.Int32)((global::System.Int32)o.@SourceId))); 
            WriteEndElement(o);
        }

        protected override void InitCallbacks() { 
        }
    } 
 
    internal class XmlSerializationReaderDataSvcMapFile : System.Xml.Serialization.XmlSerializationReader {
 
        public object Read8_ReferenceGroup() {
            object o = null;
            Reader.MoveToContent();
            if (Reader.NodeType == System.Xml.XmlNodeType.Element) { 
                if (((object) Reader.LocalName == (object)id1_ReferenceGroup && (object) Reader.NamespaceURI == (object)id2_Item)) {
                    o = Read7_DataSvcMapFile(true, true); 
                } 
                else {
                    throw CreateUnknownNodeException(); 
                }
            }
            else {
                UnknownNode(null, @"urn:schemas-microsoft-com:xml-dataservicemap:ReferenceGroup"); 
            }
            return (object)o; 
        } 

        global::System.Web.Compilation.WCFModel.DataSvcMapFile Read7_DataSvcMapFile(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)id3_DataSvcMapFile && (object) ((System.Xml.XmlQualifiedName)xsiType).Namespace == (object)id2_Item)) {
            } 
            else 
                throw CreateUnknownTypeException((System.Xml.XmlQualifiedName)xsiType);
            } 
            if (isNull) return null;
            global::System.Web.Compilation.WCFModel.DataSvcMapFile o;
            o = new global::System.Web.Compilation.WCFModel.DataSvcMapFile();
            global::System.Collections.Generic.List a_0 = (global::System.Collections.Generic.List)o.@MetadataSourceList; 
            global::System.Collections.Generic.List a_1 = (global::System.Collections.Generic.List)o.@MetadataList;
            global::System.Collections.Generic.List a_2 = (global::System.Collections.Generic.List)o.@Extensions; 
            bool[] paramsRead = new bool[4]; 
            while (Reader.MoveToNextAttribute()) {
                if (!paramsRead[3] && ((object) Reader.LocalName == (object)id4_ID && (object) Reader.NamespaceURI == (object)id5_Item)) { 
                    o.@ID = Reader.Value;
                    paramsRead[3] = true;
                }
                else if (!IsXmlnsAttribute(Reader.Name)) { 
                    UnknownNode((object)o, @":ID");
                } 
            } 
            Reader.MoveToElement();
            if (Reader.IsEmptyElement) { 
                Reader.Skip();
                return o;
            }
            Reader.ReadStartElement(); 
            int state = 0;
            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) {
                    switch (state) {
                    case 0:
                        if (((object) Reader.LocalName == (object)id6_MetadataSources && (object) Reader.NamespaceURI == (object)id2_Item)) { 
                            if (!ReadNull()) {
                                global::System.Collections.Generic.List a_0_0 = (global::System.Collections.Generic.List)o.@MetadataSourceList; 
                                if (((object)(a_0_0) == null) || (Reader.IsEmptyElement)) { 
                                    Reader.Skip();
                                } 
                                else {
                                    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) { 
                                            if (((object) Reader.LocalName == (object)id7_MetadataSource && (object) Reader.NamespaceURI == (object)id2_Item)) {
                                                if ((object)(a_0_0) == null) Reader.Skip(); else a_0_0.Add(Read6_MetadataSource(true, true)); 
                                            }
                                            else {
                                                UnknownNode(null, @"urn:schemas-microsoft-com:xml-dataservicemap:MetadataSource");
                                            } 
                                        }
                                        else { 
                                            UnknownNode(null, @"urn:schemas-microsoft-com:xml-dataservicemap:MetadataSource"); 
                                        }
                                        Reader.MoveToContent(); 
                                        CheckReaderCount(ref whileIterations1, ref readerCount1);
                                    }
                                ReadEndElement();
                                } 
                            }
                        } 
                        else { 
                            state = 1;
                        } 
                        break;
                    case 1:
                        if (((object) Reader.LocalName == (object)id8_Metadata && (object) Reader.NamespaceURI == (object)id2_Item)) {
                            if (!ReadNull()) { 
                                global::System.Collections.Generic.List a_1_0 = (global::System.Collections.Generic.List)o.@MetadataList;
                                if (((object)(a_1_0) == null) || (Reader.IsEmptyElement)) { 
                                    Reader.Skip(); 
                                }
                                else { 
                                    Reader.ReadStartElement();
                                    Reader.MoveToContent();
                                    int whileIterations2 = 0;
                                    int readerCount2 = ReaderCount; 
                                    while (Reader.NodeType != System.Xml.XmlNodeType.EndElement && Reader.NodeType != System.Xml.XmlNodeType.None) {
                                        if (Reader.NodeType == System.Xml.XmlNodeType.Element) { 
                                            if (((object) Reader.LocalName == (object)id9_MetadataFile && (object) Reader.NamespaceURI == (object)id2_Item)) { 
                                                if ((object)(a_1_0) == null) Reader.Skip(); else a_1_0.Add(Read5_MetadataFile(true, true));
                                            } 
                                            else {
                                                UnknownNode(null, @"urn:schemas-microsoft-com:xml-dataservicemap:MetadataFile");
                                            }
                                        } 
                                        else {
                                            UnknownNode(null, @"urn:schemas-microsoft-com:xml-dataservicemap:MetadataFile"); 
                                        } 
                                        Reader.MoveToContent();
                                        CheckReaderCount(ref whileIterations2, ref readerCount2); 
                                    }
                                ReadEndElement();
                                }
                            } 
                        }
                        else { 
                            state = 2; 
                        }
                        break; 
                    case 2:
                        if (((object) Reader.LocalName == (object)id10_Extensions && (object) Reader.NamespaceURI == (object)id2_Item)) {
                            if (!ReadNull()) {
                                global::System.Collections.Generic.List a_2_0 = (global::System.Collections.Generic.List)o.@Extensions; 
                                if (((object)(a_2_0) == null) || (Reader.IsEmptyElement)) {
                                    Reader.Skip(); 
                                } 
                                else {
                                    Reader.ReadStartElement(); 
                                    Reader.MoveToContent();
                                    int whileIterations3 = 0;
                                    int readerCount3 = ReaderCount;
                                    while (Reader.NodeType != System.Xml.XmlNodeType.EndElement && Reader.NodeType != System.Xml.XmlNodeType.None) { 
                                        if (Reader.NodeType == System.Xml.XmlNodeType.Element) {
                                            if (((object) Reader.LocalName == (object)id11_ExtensionFile && (object) Reader.NamespaceURI == (object)id2_Item)) { 
                                                if ((object)(a_2_0) == null) Reader.Skip(); else a_2_0.Add(Read3_ExtensionFile(true, true)); 
                                            }
                                            else { 
                                                UnknownNode(null, @"urn:schemas-microsoft-com:xml-dataservicemap:ExtensionFile");
                                            }
                                        }
                                        else { 
                                            UnknownNode(null, @"urn:schemas-microsoft-com:xml-dataservicemap:ExtensionFile");
                                        } 
                                        Reader.MoveToContent(); 
                                        CheckReaderCount(ref whileIterations3, ref readerCount3);
                                    } 
                                ReadEndElement();
                                }
                            }
                        } 
                        else {
                            state = 3; 
                        } 
                        break;
                    default: 
                        UnknownNode((object)o, null);
                        break;
                    }
                } 
                else {
                    UnknownNode((object)o, null); 
                } 
                Reader.MoveToContent();
                CheckReaderCount(ref whileIterations0, ref readerCount0); 
            }
            ReadEndElement();
            return o;
        } 

        global::System.Web.Compilation.WCFModel.ExtensionFile Read3_ExtensionFile(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)id11_ExtensionFile && (object) ((System.Xml.XmlQualifiedName)xsiType).Namespace == (object)id2_Item)) {
            }
            else 
                throw CreateUnknownTypeException((System.Xml.XmlQualifiedName)xsiType);
            } 
            if (isNull) return null; 
            global::System.Web.Compilation.WCFModel.ExtensionFile o;
            o = new global::System.Web.Compilation.WCFModel.ExtensionFile(); 
            bool[] paramsRead = new bool[2];
            while (Reader.MoveToNextAttribute()) {
                if (!paramsRead[0] && ((object) Reader.LocalName == (object)id12_FileName && (object) Reader.NamespaceURI == (object)id5_Item)) {
                    o.@FileName = Reader.Value; 
                    paramsRead[0] = true;
                } 
                else if (!paramsRead[1] && ((object) Reader.LocalName == (object)id13_Name && (object) Reader.NamespaceURI == (object)id5_Item)) { 
                    o.@Name = Reader.Value;
                    paramsRead[1] = true; 
                }
                else if (!IsXmlnsAttribute(Reader.Name)) {
                    UnknownNode((object)o, @":FileName, :Name");
                } 
            }
            Reader.MoveToElement(); 
            if (Reader.IsEmptyElement) { 
                Reader.Skip();
                return o; 
            }
            Reader.ReadStartElement();
            Reader.MoveToContent();
            int whileIterations4 = 0; 
            int readerCount4 = 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 whileIterations4, ref readerCount4);
            } 
            ReadEndElement(); 
            return o;
        } 

        global::System.Web.Compilation.WCFModel.MetadataFile Read5_MetadataFile(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)id9_MetadataFile && (object) ((System.Xml.XmlQualifiedName)xsiType).Namespace == (object)id2_Item)) { 
            }
            else 
                throw CreateUnknownTypeException((System.Xml.XmlQualifiedName)xsiType);
            }
            if (isNull) return null;
            global::System.Web.Compilation.WCFModel.MetadataFile o; 
            o = new global::System.Web.Compilation.WCFModel.MetadataFile();
            bool[] paramsRead = new bool[7]; 
            while (Reader.MoveToNextAttribute()) { 
                if (!paramsRead[0] && ((object) Reader.LocalName == (object)id12_FileName && (object) Reader.NamespaceURI == (object)id5_Item)) {
                    o.@FileName = Reader.Value; 
                    paramsRead[0] = true;
                }
                else if (!paramsRead[1] && ((object) Reader.LocalName == (object)id14_MetadataType && (object) Reader.NamespaceURI == (object)id5_Item)) {
                    o.@FileType = Read4_MetadataType(Reader.Value); 
                    paramsRead[1] = true;
                } 
                else if (!paramsRead[2] && ((object) Reader.LocalName == (object)id4_ID && (object) Reader.NamespaceURI == (object)id5_Item)) { 
                    o.@ID = Reader.Value;
                    paramsRead[2] = true; 
                }
                else if (!paramsRead[3] && ((object) Reader.LocalName == (object)id15_Ignore && (object) Reader.NamespaceURI == (object)id5_Item)) {
                    o.@Ignore = System.Xml.XmlConvert.ToBoolean(Reader.Value);
                    o.@IgnoreSpecified = true; 
                    paramsRead[3] = true;
                } 
                else if (!paramsRead[4] && ((object) Reader.LocalName == (object)id16_IsMergeResult && (object) Reader.NamespaceURI == (object)id5_Item)) { 
                    o.@IsMergeResult = System.Xml.XmlConvert.ToBoolean(Reader.Value);
                    o.@IsMergeResultSpecified = true; 
                    paramsRead[4] = true;
                }
                else if (!paramsRead[5] && ((object) Reader.LocalName == (object)id17_SourceId && (object) Reader.NamespaceURI == (object)id5_Item)) {
                    o.@SourceId = System.Xml.XmlConvert.ToInt32(Reader.Value); 
                    o.@SourceIdSpecified = true;
                    paramsRead[5] = true; 
                } 
                else if (!paramsRead[6] && ((object) Reader.LocalName == (object)id18_SourceUrl && (object) Reader.NamespaceURI == (object)id5_Item)) {
                    o.@SourceUrl = Reader.Value; 
                    paramsRead[6] = true;
                }
                else if (!IsXmlnsAttribute(Reader.Name)) {
                    UnknownNode((object)o, @":FileName, :MetadataType, :ID, :Ignore, :IsMergeResult, :SourceId, :SourceUrl"); 
                }
            } 
            Reader.MoveToElement(); 
            if (Reader.IsEmptyElement) {
                Reader.Skip(); 
                return o;
            }
            Reader.ReadStartElement();
            Reader.MoveToContent(); 
            int whileIterations5 = 0;
            int readerCount5 = 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 whileIterations5, ref readerCount5); 
            } 
            ReadEndElement();
            return o; 
        }

        global::System.Web.Compilation.WCFModel.MetadataFile.MetadataType Read4_MetadataType(string s) {
            switch (s) { 
                case @"Unknown": return global::System.Web.Compilation.WCFModel.MetadataFile.MetadataType.@Unknown;
                case @"Disco": return global::System.Web.Compilation.WCFModel.MetadataFile.MetadataType.@Disco; 
                case @"Wsdl": return global::System.Web.Compilation.WCFModel.MetadataFile.MetadataType.@Wsdl; 
                case @"Schema": return global::System.Web.Compilation.WCFModel.MetadataFile.MetadataType.@Schema;
                case @"Policy": return global::System.Web.Compilation.WCFModel.MetadataFile.MetadataType.@Policy; 
                case @"Xml": return global::System.Web.Compilation.WCFModel.MetadataFile.MetadataType.@Xml;
                case @"Edmx": return global::System.Web.Compilation.WCFModel.MetadataFile.MetadataType.@Edmx;
                default: throw CreateUnknownConstantException(s, typeof(global::System.Web.Compilation.WCFModel.MetadataFile.MetadataType));
            } 
        }
 
        global::System.Web.Compilation.WCFModel.MetadataSource Read6_MetadataSource(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)id7_MetadataSource && (object) ((System.Xml.XmlQualifiedName)xsiType).Namespace == (object)id2_Item)) {
            } 
            else
                throw CreateUnknownTypeException((System.Xml.XmlQualifiedName)xsiType); 
            } 
            if (isNull) return null;
            global::System.Web.Compilation.WCFModel.MetadataSource o; 
            o = new global::System.Web.Compilation.WCFModel.MetadataSource();
            bool[] paramsRead = new bool[3];
            while (Reader.MoveToNextAttribute()) {
                if (!paramsRead[0] && ((object) Reader.LocalName == (object)id19_Address && (object) Reader.NamespaceURI == (object)id5_Item)) { 
                    o.@Address = Reader.Value;
                    paramsRead[0] = true; 
                } 
                else if (!paramsRead[1] && ((object) Reader.LocalName == (object)id20_Protocol && (object) Reader.NamespaceURI == (object)id5_Item)) {
                    o.@Protocol = Reader.Value; 
                    paramsRead[1] = true;
                }
                else if (!paramsRead[2] && ((object) Reader.LocalName == (object)id17_SourceId && (object) Reader.NamespaceURI == (object)id5_Item)) {
                    o.@SourceId = System.Xml.XmlConvert.ToInt32(Reader.Value); 
                    paramsRead[2] = true;
                } 
                else if (!IsXmlnsAttribute(Reader.Name)) { 
                    UnknownNode((object)o, @":Address, :Protocol, :SourceId");
                } 
            }
            Reader.MoveToElement();
            if (Reader.IsEmptyElement) {
                Reader.Skip(); 
                return o;
            } 
            Reader.ReadStartElement(); 
            Reader.MoveToContent();
            int whileIterations6 = 0; 
            int readerCount6 = 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 whileIterations6, ref readerCount6);
            }
            ReadEndElement();
            return o; 
        }
 
        protected override void InitCallbacks() { 
        }
 
        string id3_DataSvcMapFile;
        string id9_MetadataFile;
        string id10_Extensions;
        string id11_ExtensionFile; 
        string id8_Metadata;
        string id6_MetadataSources; 
        string id17_SourceId; 
        string id1_ReferenceGroup;
        string id4_ID; 
        string id5_Item;
        string id7_MetadataSource;
        string id13_Name;
        string id14_MetadataType; 
        string id19_Address;
        string id18_SourceUrl; 
        string id16_IsMergeResult; 
        string id15_Ignore;
        string id20_Protocol; 
        string id2_Item;
        string id12_FileName;

        protected override void InitIDs() { 
            id3_DataSvcMapFile = Reader.NameTable.Add(@"DataSvcMapFile");
            id9_MetadataFile = Reader.NameTable.Add(@"MetadataFile"); 
            id10_Extensions = Reader.NameTable.Add(@"Extensions"); 
            id11_ExtensionFile = Reader.NameTable.Add(@"ExtensionFile");
            id8_Metadata = Reader.NameTable.Add(@"Metadata"); 
            id6_MetadataSources = Reader.NameTable.Add(@"MetadataSources");
            id17_SourceId = Reader.NameTable.Add(@"SourceId");
            id1_ReferenceGroup = Reader.NameTable.Add(@"ReferenceGroup");
            id4_ID = Reader.NameTable.Add(@"ID"); 
            id5_Item = Reader.NameTable.Add(@"");
            id7_MetadataSource = Reader.NameTable.Add(@"MetadataSource"); 
            id13_Name = Reader.NameTable.Add(@"Name"); 
            id14_MetadataType = Reader.NameTable.Add(@"MetadataType");
            id19_Address = Reader.NameTable.Add(@"Address"); 
            id18_SourceUrl = Reader.NameTable.Add(@"SourceUrl");
            id16_IsMergeResult = Reader.NameTable.Add(@"IsMergeResult");
            id15_Ignore = Reader.NameTable.Add(@"Ignore");
            id20_Protocol = Reader.NameTable.Add(@"Protocol"); 
            id2_Item = Reader.NameTable.Add(@"urn:schemas-microsoft-com:xml-dataservicemap");
            id12_FileName = Reader.NameTable.Add(@"FileName"); 
        } 
    }
 
    internal abstract class XmlSerializer1 : System.Xml.Serialization.XmlSerializer {
        protected override System.Xml.Serialization.XmlSerializationReader CreateReader() {
            return new XmlSerializationReaderDataSvcMapFile();
        } 
        protected override System.Xml.Serialization.XmlSerializationWriter CreateWriter() {
            return new XmlSerializationWriterDataSvcMapFile(); 
        } 
    }
 
    internal sealed class DataSvcMapFileSerializer : XmlSerializer1 {

        public override System.Boolean CanDeserialize(System.Xml.XmlReader xmlReader) {
            return xmlReader.IsStartElement(@"ReferenceGroup", @"urn:schemas-microsoft-com:xml-dataservicemap"); 
        }
 
        protected override void Serialize(object objectToSerialize, System.Xml.Serialization.XmlSerializationWriter writer) { 
            ((XmlSerializationWriterDataSvcMapFile)writer).Write8_ReferenceGroup(objectToSerialize);
        } 

        protected override object Deserialize(System.Xml.Serialization.XmlSerializationReader reader) {
            return ((XmlSerializationReaderDataSvcMapFile)reader).Read8_ReferenceGroup();
        } 
    }
 
    internal class XmlSerializerContract : global::System.Xml.Serialization.XmlSerializerImplementation { 
        public override global::System.Xml.Serialization.XmlSerializationReader Reader { get { return new XmlSerializationReaderDataSvcMapFile(); } }
        public override global::System.Xml.Serialization.XmlSerializationWriter Writer { get { return new XmlSerializationWriterDataSvcMapFile(); } } 
        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.Web.Compilation.WCFModel.DataSvcMapFile:urn:schemas-microsoft-com:xml-dataservicemap:ReferenceGroup:True:"] = @"Read8_ReferenceGroup"; 
                    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.Web.Compilation.WCFModel.DataSvcMapFile:urn:schemas-microsoft-com:xml-dataservicemap:ReferenceGroup:True:"] = @"Write8_ReferenceGroup";
                    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.Web.Compilation.WCFModel.DataSvcMapFile:urn:schemas-microsoft-com:xml-dataservicemap:ReferenceGroup:True:", new DataSvcMapFileSerializer());
                    if (typedSerializers == null) typedSerializers = _tmp;
                }
                return typedSerializers; 
            }
        } 
        public override System.Boolean CanSerialize(System.Type type) { 
            if (type == typeof(global::System.Web.Compilation.WCFModel.DataSvcMapFile)) return true;
            return false; 
        }
        public override System.Xml.Serialization.XmlSerializer GetSerializer(System.Type type) {
            if (type == typeof(global::System.Web.Compilation.WCFModel.DataSvcMapFile)) return new DataSvcMapFileSerializer();
            return null; 
        }
    } 
} 

// File provided for Reference Use Only by Microsoft Corporation (c) 2007.
// Copyright (c) Microsoft Corporation. All rights reserved.
//------------------------------------------------------------------------------ 
// 
//   Copyright (C) Microsoft Corporation. All Rights Reserved.
// 
//----------------------------------------------------------------------------- 

//  This file is generated. DO NOT MODIFY IT BY HAND. 
// Please read HowToUpdateSerializer.txt in the parent directory to see how to update it. 

 
namespace System.Web.Compilation.XmlSerializerDataSvc {

    internal class XmlSerializationWriterDataSvcMapFile : System.Xml.Serialization.XmlSerializationWriter {
 
        public void Write8_ReferenceGroup(object o) {
            WriteStartDocument(); 
            if (o == null) { 
                WriteNullTagLiteral(@"ReferenceGroup", @"urn:schemas-microsoft-com:xml-dataservicemap");
                return; 
            }
            TopLevelElement();
            Write7_DataSvcMapFile(@"ReferenceGroup", @"urn:schemas-microsoft-com:xml-dataservicemap", ((global::System.Web.Compilation.WCFModel.DataSvcMapFile)o), true, false);
        } 

        void Write7_DataSvcMapFile(string n, string ns, global::System.Web.Compilation.WCFModel.DataSvcMapFile 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.Web.Compilation.WCFModel.DataSvcMapFile)) { 
                }
                else { 
                    throw CreateUnknownTypeException(o); 
                }
            } 
            WriteStartElement(n, ns, o, false, null);
            if (needType) WriteXsiType(@"DataSvcMapFile", @"urn:schemas-microsoft-com:xml-dataservicemap");
            WriteAttribute(@"ID", @"", ((global::System.String)o.@ID));
            { 
                global::System.Collections.Generic.List a = (global::System.Collections.Generic.List)((global::System.Collections.Generic.List)o.@MetadataSourceList);
                if (a != null){ 
                    WriteStartElement(@"MetadataSources", @"urn:schemas-microsoft-com:xml-dataservicemap", null, false); 
                    for (int ia = 0; ia < ((System.Collections.ICollection)a).Count; ia++) {
                        Write6_MetadataSource(@"MetadataSource", @"urn:schemas-microsoft-com:xml-dataservicemap", ((global::System.Web.Compilation.WCFModel.MetadataSource)a[ia]), true, false); 
                    }
                    WriteEndElement();
                }
            } 
            {
                global::System.Collections.Generic.List a = (global::System.Collections.Generic.List)((global::System.Collections.Generic.List)o.@MetadataList); 
                if (a != null){ 
                    WriteStartElement(@"Metadata", @"urn:schemas-microsoft-com:xml-dataservicemap", null, false);
                    for (int ia = 0; ia < ((System.Collections.ICollection)a).Count; ia++) { 
                        Write5_MetadataFile(@"MetadataFile", @"urn:schemas-microsoft-com:xml-dataservicemap", ((global::System.Web.Compilation.WCFModel.MetadataFile)a[ia]), true, false);
                    }
                    WriteEndElement();
                } 
            }
            { 
                global::System.Collections.Generic.List a = (global::System.Collections.Generic.List)((global::System.Collections.Generic.List)o.@Extensions); 
                if (a != null){
                    WriteStartElement(@"Extensions", @"urn:schemas-microsoft-com:xml-dataservicemap", null, false); 
                    for (int ia = 0; ia < ((System.Collections.ICollection)a).Count; ia++) {
                        Write3_ExtensionFile(@"ExtensionFile", @"urn:schemas-microsoft-com:xml-dataservicemap", ((global::System.Web.Compilation.WCFModel.ExtensionFile)a[ia]), true, false);
                    }
                    WriteEndElement(); 
                }
            } 
            WriteEndElement(o); 
        }
 
        void Write3_ExtensionFile(string n, string ns, global::System.Web.Compilation.WCFModel.ExtensionFile 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.Web.Compilation.WCFModel.ExtensionFile)) {
                } 
                else {
                    throw CreateUnknownTypeException(o);
                }
            } 
            WriteStartElement(n, ns, o, false, null);
            if (needType) WriteXsiType(@"ExtensionFile", @"urn:schemas-microsoft-com:xml-dataservicemap"); 
            WriteAttribute(@"FileName", @"", ((global::System.String)o.@FileName)); 
            WriteAttribute(@"Name", @"", ((global::System.String)o.@Name));
            WriteEndElement(o); 
        }

        void Write5_MetadataFile(string n, string ns, global::System.Web.Compilation.WCFModel.MetadataFile 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.Web.Compilation.WCFModel.MetadataFile)) {
                }
                else {
                    throw CreateUnknownTypeException(o); 
                }
            } 
            WriteStartElement(n, ns, o, false, null); 
            if (needType) WriteXsiType(@"MetadataFile", @"urn:schemas-microsoft-com:xml-dataservicemap");
            WriteAttribute(@"FileName", @"", ((global::System.String)o.@FileName)); 
            WriteAttribute(@"MetadataType", @"", Write4_MetadataType(((global::System.Web.Compilation.WCFModel.MetadataFile.MetadataType)o.@FileType)));
            WriteAttribute(@"ID", @"", ((global::System.String)o.@ID));
            if (o.@IgnoreSpecified) {
                WriteAttribute(@"Ignore", @"", System.Xml.XmlConvert.ToString((global::System.Boolean)((global::System.Boolean)o.@Ignore))); 
            }
            if (o.@IsMergeResultSpecified) { 
                WriteAttribute(@"IsMergeResult", @"", System.Xml.XmlConvert.ToString((global::System.Boolean)((global::System.Boolean)o.@IsMergeResult))); 
            }
            if (o.@SourceIdSpecified) { 
                WriteAttribute(@"SourceId", @"", System.Xml.XmlConvert.ToString((global::System.Int32)((global::System.Int32)o.@SourceId)));
            }
            WriteAttribute(@"SourceUrl", @"", ((global::System.String)o.@SourceUrl));
            if (o.@IgnoreSpecified) { 
            }
            if (o.@IsMergeResultSpecified) { 
            } 
            if (o.@SourceIdSpecified) {
            } 
            WriteEndElement(o);
        }

        string Write4_MetadataType(global::System.Web.Compilation.WCFModel.MetadataFile.MetadataType v) { 
            string s = null;
            switch (v) { 
                case global::System.Web.Compilation.WCFModel.MetadataFile.MetadataType.@Unknown: s = @"Unknown"; break; 
                case global::System.Web.Compilation.WCFModel.MetadataFile.MetadataType.@Disco: s = @"Disco"; break;
                case global::System.Web.Compilation.WCFModel.MetadataFile.MetadataType.@Wsdl: s = @"Wsdl"; break; 
                case global::System.Web.Compilation.WCFModel.MetadataFile.MetadataType.@Schema: s = @"Schema"; break;
                case global::System.Web.Compilation.WCFModel.MetadataFile.MetadataType.@Policy: s = @"Policy"; break;
                case global::System.Web.Compilation.WCFModel.MetadataFile.MetadataType.@Xml: s = @"Xml"; break;
                case global::System.Web.Compilation.WCFModel.MetadataFile.MetadataType.@Edmx: s = @"Edmx"; break; 
                default: throw CreateInvalidEnumValueException(((System.Int64)v).ToString(System.Globalization.CultureInfo.InvariantCulture), @"System.Web.Compilation.WCFModel.MetadataFile.MetadataType");
            } 
            return s; 
        }
 
        void Write6_MetadataSource(string n, string ns, global::System.Web.Compilation.WCFModel.MetadataSource 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.Web.Compilation.WCFModel.MetadataSource)) {
                } 
                else {
                    throw CreateUnknownTypeException(o);
                }
            } 
            WriteStartElement(n, ns, o, false, null);
            if (needType) WriteXsiType(@"MetadataSource", @"urn:schemas-microsoft-com:xml-dataservicemap"); 
            WriteAttribute(@"Address", @"", ((global::System.String)o.@Address)); 
            WriteAttribute(@"Protocol", @"", ((global::System.String)o.@Protocol));
            WriteAttribute(@"SourceId", @"", System.Xml.XmlConvert.ToString((global::System.Int32)((global::System.Int32)o.@SourceId))); 
            WriteEndElement(o);
        }

        protected override void InitCallbacks() { 
        }
    } 
 
    internal class XmlSerializationReaderDataSvcMapFile : System.Xml.Serialization.XmlSerializationReader {
 
        public object Read8_ReferenceGroup() {
            object o = null;
            Reader.MoveToContent();
            if (Reader.NodeType == System.Xml.XmlNodeType.Element) { 
                if (((object) Reader.LocalName == (object)id1_ReferenceGroup && (object) Reader.NamespaceURI == (object)id2_Item)) {
                    o = Read7_DataSvcMapFile(true, true); 
                } 
                else {
                    throw CreateUnknownNodeException(); 
                }
            }
            else {
                UnknownNode(null, @"urn:schemas-microsoft-com:xml-dataservicemap:ReferenceGroup"); 
            }
            return (object)o; 
        } 

        global::System.Web.Compilation.WCFModel.DataSvcMapFile Read7_DataSvcMapFile(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)id3_DataSvcMapFile && (object) ((System.Xml.XmlQualifiedName)xsiType).Namespace == (object)id2_Item)) {
            } 
            else 
                throw CreateUnknownTypeException((System.Xml.XmlQualifiedName)xsiType);
            } 
            if (isNull) return null;
            global::System.Web.Compilation.WCFModel.DataSvcMapFile o;
            o = new global::System.Web.Compilation.WCFModel.DataSvcMapFile();
            global::System.Collections.Generic.List a_0 = (global::System.Collections.Generic.List)o.@MetadataSourceList; 
            global::System.Collections.Generic.List a_1 = (global::System.Collections.Generic.List)o.@MetadataList;
            global::System.Collections.Generic.List a_2 = (global::System.Collections.Generic.List)o.@Extensions; 
            bool[] paramsRead = new bool[4]; 
            while (Reader.MoveToNextAttribute()) {
                if (!paramsRead[3] && ((object) Reader.LocalName == (object)id4_ID && (object) Reader.NamespaceURI == (object)id5_Item)) { 
                    o.@ID = Reader.Value;
                    paramsRead[3] = true;
                }
                else if (!IsXmlnsAttribute(Reader.Name)) { 
                    UnknownNode((object)o, @":ID");
                } 
            } 
            Reader.MoveToElement();
            if (Reader.IsEmptyElement) { 
                Reader.Skip();
                return o;
            }
            Reader.ReadStartElement(); 
            int state = 0;
            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) {
                    switch (state) {
                    case 0:
                        if (((object) Reader.LocalName == (object)id6_MetadataSources && (object) Reader.NamespaceURI == (object)id2_Item)) { 
                            if (!ReadNull()) {
                                global::System.Collections.Generic.List a_0_0 = (global::System.Collections.Generic.List)o.@MetadataSourceList; 
                                if (((object)(a_0_0) == null) || (Reader.IsEmptyElement)) { 
                                    Reader.Skip();
                                } 
                                else {
                                    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) { 
                                            if (((object) Reader.LocalName == (object)id7_MetadataSource && (object) Reader.NamespaceURI == (object)id2_Item)) {
                                                if ((object)(a_0_0) == null) Reader.Skip(); else a_0_0.Add(Read6_MetadataSource(true, true)); 
                                            }
                                            else {
                                                UnknownNode(null, @"urn:schemas-microsoft-com:xml-dataservicemap:MetadataSource");
                                            } 
                                        }
                                        else { 
                                            UnknownNode(null, @"urn:schemas-microsoft-com:xml-dataservicemap:MetadataSource"); 
                                        }
                                        Reader.MoveToContent(); 
                                        CheckReaderCount(ref whileIterations1, ref readerCount1);
                                    }
                                ReadEndElement();
                                } 
                            }
                        } 
                        else { 
                            state = 1;
                        } 
                        break;
                    case 1:
                        if (((object) Reader.LocalName == (object)id8_Metadata && (object) Reader.NamespaceURI == (object)id2_Item)) {
                            if (!ReadNull()) { 
                                global::System.Collections.Generic.List a_1_0 = (global::System.Collections.Generic.List)o.@MetadataList;
                                if (((object)(a_1_0) == null) || (Reader.IsEmptyElement)) { 
                                    Reader.Skip(); 
                                }
                                else { 
                                    Reader.ReadStartElement();
                                    Reader.MoveToContent();
                                    int whileIterations2 = 0;
                                    int readerCount2 = ReaderCount; 
                                    while (Reader.NodeType != System.Xml.XmlNodeType.EndElement && Reader.NodeType != System.Xml.XmlNodeType.None) {
                                        if (Reader.NodeType == System.Xml.XmlNodeType.Element) { 
                                            if (((object) Reader.LocalName == (object)id9_MetadataFile && (object) Reader.NamespaceURI == (object)id2_Item)) { 
                                                if ((object)(a_1_0) == null) Reader.Skip(); else a_1_0.Add(Read5_MetadataFile(true, true));
                                            } 
                                            else {
                                                UnknownNode(null, @"urn:schemas-microsoft-com:xml-dataservicemap:MetadataFile");
                                            }
                                        } 
                                        else {
                                            UnknownNode(null, @"urn:schemas-microsoft-com:xml-dataservicemap:MetadataFile"); 
                                        } 
                                        Reader.MoveToContent();
                                        CheckReaderCount(ref whileIterations2, ref readerCount2); 
                                    }
                                ReadEndElement();
                                }
                            } 
                        }
                        else { 
                            state = 2; 
                        }
                        break; 
                    case 2:
                        if (((object) Reader.LocalName == (object)id10_Extensions && (object) Reader.NamespaceURI == (object)id2_Item)) {
                            if (!ReadNull()) {
                                global::System.Collections.Generic.List a_2_0 = (global::System.Collections.Generic.List)o.@Extensions; 
                                if (((object)(a_2_0) == null) || (Reader.IsEmptyElement)) {
                                    Reader.Skip(); 
                                } 
                                else {
                                    Reader.ReadStartElement(); 
                                    Reader.MoveToContent();
                                    int whileIterations3 = 0;
                                    int readerCount3 = ReaderCount;
                                    while (Reader.NodeType != System.Xml.XmlNodeType.EndElement && Reader.NodeType != System.Xml.XmlNodeType.None) { 
                                        if (Reader.NodeType == System.Xml.XmlNodeType.Element) {
                                            if (((object) Reader.LocalName == (object)id11_ExtensionFile && (object) Reader.NamespaceURI == (object)id2_Item)) { 
                                                if ((object)(a_2_0) == null) Reader.Skip(); else a_2_0.Add(Read3_ExtensionFile(true, true)); 
                                            }
                                            else { 
                                                UnknownNode(null, @"urn:schemas-microsoft-com:xml-dataservicemap:ExtensionFile");
                                            }
                                        }
                                        else { 
                                            UnknownNode(null, @"urn:schemas-microsoft-com:xml-dataservicemap:ExtensionFile");
                                        } 
                                        Reader.MoveToContent(); 
                                        CheckReaderCount(ref whileIterations3, ref readerCount3);
                                    } 
                                ReadEndElement();
                                }
                            }
                        } 
                        else {
                            state = 3; 
                        } 
                        break;
                    default: 
                        UnknownNode((object)o, null);
                        break;
                    }
                } 
                else {
                    UnknownNode((object)o, null); 
                } 
                Reader.MoveToContent();
                CheckReaderCount(ref whileIterations0, ref readerCount0); 
            }
            ReadEndElement();
            return o;
        } 

        global::System.Web.Compilation.WCFModel.ExtensionFile Read3_ExtensionFile(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)id11_ExtensionFile && (object) ((System.Xml.XmlQualifiedName)xsiType).Namespace == (object)id2_Item)) {
            }
            else 
                throw CreateUnknownTypeException((System.Xml.XmlQualifiedName)xsiType);
            } 
            if (isNull) return null; 
            global::System.Web.Compilation.WCFModel.ExtensionFile o;
            o = new global::System.Web.Compilation.WCFModel.ExtensionFile(); 
            bool[] paramsRead = new bool[2];
            while (Reader.MoveToNextAttribute()) {
                if (!paramsRead[0] && ((object) Reader.LocalName == (object)id12_FileName && (object) Reader.NamespaceURI == (object)id5_Item)) {
                    o.@FileName = Reader.Value; 
                    paramsRead[0] = true;
                } 
                else if (!paramsRead[1] && ((object) Reader.LocalName == (object)id13_Name && (object) Reader.NamespaceURI == (object)id5_Item)) { 
                    o.@Name = Reader.Value;
                    paramsRead[1] = true; 
                }
                else if (!IsXmlnsAttribute(Reader.Name)) {
                    UnknownNode((object)o, @":FileName, :Name");
                } 
            }
            Reader.MoveToElement(); 
            if (Reader.IsEmptyElement) { 
                Reader.Skip();
                return o; 
            }
            Reader.ReadStartElement();
            Reader.MoveToContent();
            int whileIterations4 = 0; 
            int readerCount4 = 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 whileIterations4, ref readerCount4);
            } 
            ReadEndElement(); 
            return o;
        } 

        global::System.Web.Compilation.WCFModel.MetadataFile Read5_MetadataFile(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)id9_MetadataFile && (object) ((System.Xml.XmlQualifiedName)xsiType).Namespace == (object)id2_Item)) { 
            }
            else 
                throw CreateUnknownTypeException((System.Xml.XmlQualifiedName)xsiType);
            }
            if (isNull) return null;
            global::System.Web.Compilation.WCFModel.MetadataFile o; 
            o = new global::System.Web.Compilation.WCFModel.MetadataFile();
            bool[] paramsRead = new bool[7]; 
            while (Reader.MoveToNextAttribute()) { 
                if (!paramsRead[0] && ((object) Reader.LocalName == (object)id12_FileName && (object) Reader.NamespaceURI == (object)id5_Item)) {
                    o.@FileName = Reader.Value; 
                    paramsRead[0] = true;
                }
                else if (!paramsRead[1] && ((object) Reader.LocalName == (object)id14_MetadataType && (object) Reader.NamespaceURI == (object)id5_Item)) {
                    o.@FileType = Read4_MetadataType(Reader.Value); 
                    paramsRead[1] = true;
                } 
                else if (!paramsRead[2] && ((object) Reader.LocalName == (object)id4_ID && (object) Reader.NamespaceURI == (object)id5_Item)) { 
                    o.@ID = Reader.Value;
                    paramsRead[2] = true; 
                }
                else if (!paramsRead[3] && ((object) Reader.LocalName == (object)id15_Ignore && (object) Reader.NamespaceURI == (object)id5_Item)) {
                    o.@Ignore = System.Xml.XmlConvert.ToBoolean(Reader.Value);
                    o.@IgnoreSpecified = true; 
                    paramsRead[3] = true;
                } 
                else if (!paramsRead[4] && ((object) Reader.LocalName == (object)id16_IsMergeResult && (object) Reader.NamespaceURI == (object)id5_Item)) { 
                    o.@IsMergeResult = System.Xml.XmlConvert.ToBoolean(Reader.Value);
                    o.@IsMergeResultSpecified = true; 
                    paramsRead[4] = true;
                }
                else if (!paramsRead[5] && ((object) Reader.LocalName == (object)id17_SourceId && (object) Reader.NamespaceURI == (object)id5_Item)) {
                    o.@SourceId = System.Xml.XmlConvert.ToInt32(Reader.Value); 
                    o.@SourceIdSpecified = true;
                    paramsRead[5] = true; 
                } 
                else if (!paramsRead[6] && ((object) Reader.LocalName == (object)id18_SourceUrl && (object) Reader.NamespaceURI == (object)id5_Item)) {
                    o.@SourceUrl = Reader.Value; 
                    paramsRead[6] = true;
                }
                else if (!IsXmlnsAttribute(Reader.Name)) {
                    UnknownNode((object)o, @":FileName, :MetadataType, :ID, :Ignore, :IsMergeResult, :SourceId, :SourceUrl"); 
                }
            } 
            Reader.MoveToElement(); 
            if (Reader.IsEmptyElement) {
                Reader.Skip(); 
                return o;
            }
            Reader.ReadStartElement();
            Reader.MoveToContent(); 
            int whileIterations5 = 0;
            int readerCount5 = 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 whileIterations5, ref readerCount5); 
            } 
            ReadEndElement();
            return o; 
        }

        global::System.Web.Compilation.WCFModel.MetadataFile.MetadataType Read4_MetadataType(string s) {
            switch (s) { 
                case @"Unknown": return global::System.Web.Compilation.WCFModel.MetadataFile.MetadataType.@Unknown;
                case @"Disco": return global::System.Web.Compilation.WCFModel.MetadataFile.MetadataType.@Disco; 
                case @"Wsdl": return global::System.Web.Compilation.WCFModel.MetadataFile.MetadataType.@Wsdl; 
                case @"Schema": return global::System.Web.Compilation.WCFModel.MetadataFile.MetadataType.@Schema;
                case @"Policy": return global::System.Web.Compilation.WCFModel.MetadataFile.MetadataType.@Policy; 
                case @"Xml": return global::System.Web.Compilation.WCFModel.MetadataFile.MetadataType.@Xml;
                case @"Edmx": return global::System.Web.Compilation.WCFModel.MetadataFile.MetadataType.@Edmx;
                default: throw CreateUnknownConstantException(s, typeof(global::System.Web.Compilation.WCFModel.MetadataFile.MetadataType));
            } 
        }
 
        global::System.Web.Compilation.WCFModel.MetadataSource Read6_MetadataSource(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)id7_MetadataSource && (object) ((System.Xml.XmlQualifiedName)xsiType).Namespace == (object)id2_Item)) {
            } 
            else
                throw CreateUnknownTypeException((System.Xml.XmlQualifiedName)xsiType); 
            } 
            if (isNull) return null;
            global::System.Web.Compilation.WCFModel.MetadataSource o; 
            o = new global::System.Web.Compilation.WCFModel.MetadataSource();
            bool[] paramsRead = new bool[3];
            while (Reader.MoveToNextAttribute()) {
                if (!paramsRead[0] && ((object) Reader.LocalName == (object)id19_Address && (object) Reader.NamespaceURI == (object)id5_Item)) { 
                    o.@Address = Reader.Value;
                    paramsRead[0] = true; 
                } 
                else if (!paramsRead[1] && ((object) Reader.LocalName == (object)id20_Protocol && (object) Reader.NamespaceURI == (object)id5_Item)) {
                    o.@Protocol = Reader.Value; 
                    paramsRead[1] = true;
                }
                else if (!paramsRead[2] && ((object) Reader.LocalName == (object)id17_SourceId && (object) Reader.NamespaceURI == (object)id5_Item)) {
                    o.@SourceId = System.Xml.XmlConvert.ToInt32(Reader.Value); 
                    paramsRead[2] = true;
                } 
                else if (!IsXmlnsAttribute(Reader.Name)) { 
                    UnknownNode((object)o, @":Address, :Protocol, :SourceId");
                } 
            }
            Reader.MoveToElement();
            if (Reader.IsEmptyElement) {
                Reader.Skip(); 
                return o;
            } 
            Reader.ReadStartElement(); 
            Reader.MoveToContent();
            int whileIterations6 = 0; 
            int readerCount6 = 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 whileIterations6, ref readerCount6);
            }
            ReadEndElement();
            return o; 
        }
 
        protected override void InitCallbacks() { 
        }
 
        string id3_DataSvcMapFile;
        string id9_MetadataFile;
        string id10_Extensions;
        string id11_ExtensionFile; 
        string id8_Metadata;
        string id6_MetadataSources; 
        string id17_SourceId; 
        string id1_ReferenceGroup;
        string id4_ID; 
        string id5_Item;
        string id7_MetadataSource;
        string id13_Name;
        string id14_MetadataType; 
        string id19_Address;
        string id18_SourceUrl; 
        string id16_IsMergeResult; 
        string id15_Ignore;
        string id20_Protocol; 
        string id2_Item;
        string id12_FileName;

        protected override void InitIDs() { 
            id3_DataSvcMapFile = Reader.NameTable.Add(@"DataSvcMapFile");
            id9_MetadataFile = Reader.NameTable.Add(@"MetadataFile"); 
            id10_Extensions = Reader.NameTable.Add(@"Extensions"); 
            id11_ExtensionFile = Reader.NameTable.Add(@"ExtensionFile");
            id8_Metadata = Reader.NameTable.Add(@"Metadata"); 
            id6_MetadataSources = Reader.NameTable.Add(@"MetadataSources");
            id17_SourceId = Reader.NameTable.Add(@"SourceId");
            id1_ReferenceGroup = Reader.NameTable.Add(@"ReferenceGroup");
            id4_ID = Reader.NameTable.Add(@"ID"); 
            id5_Item = Reader.NameTable.Add(@"");
            id7_MetadataSource = Reader.NameTable.Add(@"MetadataSource"); 
            id13_Name = Reader.NameTable.Add(@"Name"); 
            id14_MetadataType = Reader.NameTable.Add(@"MetadataType");
            id19_Address = Reader.NameTable.Add(@"Address"); 
            id18_SourceUrl = Reader.NameTable.Add(@"SourceUrl");
            id16_IsMergeResult = Reader.NameTable.Add(@"IsMergeResult");
            id15_Ignore = Reader.NameTable.Add(@"Ignore");
            id20_Protocol = Reader.NameTable.Add(@"Protocol"); 
            id2_Item = Reader.NameTable.Add(@"urn:schemas-microsoft-com:xml-dataservicemap");
            id12_FileName = Reader.NameTable.Add(@"FileName"); 
        } 
    }
 
    internal abstract class XmlSerializer1 : System.Xml.Serialization.XmlSerializer {
        protected override System.Xml.Serialization.XmlSerializationReader CreateReader() {
            return new XmlSerializationReaderDataSvcMapFile();
        } 
        protected override System.Xml.Serialization.XmlSerializationWriter CreateWriter() {
            return new XmlSerializationWriterDataSvcMapFile(); 
        } 
    }
 
    internal sealed class DataSvcMapFileSerializer : XmlSerializer1 {

        public override System.Boolean CanDeserialize(System.Xml.XmlReader xmlReader) {
            return xmlReader.IsStartElement(@"ReferenceGroup", @"urn:schemas-microsoft-com:xml-dataservicemap"); 
        }
 
        protected override void Serialize(object objectToSerialize, System.Xml.Serialization.XmlSerializationWriter writer) { 
            ((XmlSerializationWriterDataSvcMapFile)writer).Write8_ReferenceGroup(objectToSerialize);
        } 

        protected override object Deserialize(System.Xml.Serialization.XmlSerializationReader reader) {
            return ((XmlSerializationReaderDataSvcMapFile)reader).Read8_ReferenceGroup();
        } 
    }
 
    internal class XmlSerializerContract : global::System.Xml.Serialization.XmlSerializerImplementation { 
        public override global::System.Xml.Serialization.XmlSerializationReader Reader { get { return new XmlSerializationReaderDataSvcMapFile(); } }
        public override global::System.Xml.Serialization.XmlSerializationWriter Writer { get { return new XmlSerializationWriterDataSvcMapFile(); } } 
        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.Web.Compilation.WCFModel.DataSvcMapFile:urn:schemas-microsoft-com:xml-dataservicemap:ReferenceGroup:True:"] = @"Read8_ReferenceGroup"; 
                    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.Web.Compilation.WCFModel.DataSvcMapFile:urn:schemas-microsoft-com:xml-dataservicemap:ReferenceGroup:True:"] = @"Write8_ReferenceGroup";
                    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.Web.Compilation.WCFModel.DataSvcMapFile:urn:schemas-microsoft-com:xml-dataservicemap:ReferenceGroup:True:", new DataSvcMapFileSerializer());
                    if (typedSerializers == null) typedSerializers = _tmp;
                }
                return typedSerializers; 
            }
        } 
        public override System.Boolean CanSerialize(System.Type type) { 
            if (type == typeof(global::System.Web.Compilation.WCFModel.DataSvcMapFile)) return true;
            return false; 
        }
        public override System.Xml.Serialization.XmlSerializer GetSerializer(System.Type type) {
            if (type == typeof(global::System.Web.Compilation.WCFModel.DataSvcMapFile)) return new DataSvcMapFileSerializer();
            return null; 
        }
    } 
} 

// File provided for Reference Use Only by Microsoft Corporation (c) 2007.
// Copyright (c) Microsoft Corporation. All rights reserved.
                        

Link Menu

Network programming in C#, Network Programming in VB.NET, Network Programming in .NET
This book is available now!
Buy at Amazon US or
Buy at Amazon UK