void Write2_Categories(string n, string ns, global::Catalog.Categories 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::Catalog.Categories)) { } else { throw CreateUnknownTypeException(o); } } WriteStartElement(n, ns, o, false, null); if (needType) { WriteXsiType(@"Categories", @""); } WriteElementStringRaw(@"Id", @"", System.Xml.XmlConvert.ToString((global::System.Int32)((global::System.Int32)o.@Id))); WriteElementString(@"Name", @"", ((global::System.String)o.@Name)); WriteElementString(@"Description", @"", ((global::System.String)o.@Description)); WriteEndElement(o); }
global::Catalog.Categories Read2_Categories(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_Categories && (object)((System.Xml.XmlQualifiedName)xsiType).Namespace == (object)id2_Item)) { } else { throw CreateUnknownTypeException((System.Xml.XmlQualifiedName)xsiType); } } if (isNull) { return(null); } global::Catalog.Categories o; o = new global::Catalog.Categories(); bool[] paramsRead = new bool[3]; while (Reader.MoveToNextAttribute()) { if (!IsXmlnsAttribute(Reader.Name)) { UnknownNode((object)o); } } Reader.MoveToElement(); if (Reader.IsEmptyElement) { Reader.Skip(); return(o); } 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) { do { if (!paramsRead[0] && ((object)Reader.LocalName == (object)id5_Id && (object)Reader.NamespaceURI == (object)id2_Item)) { { o.@Id = System.Xml.XmlConvert.ToInt32(Reader.ReadElementString()); } paramsRead[0] = true; break; } if (!paramsRead[1] && ((object)Reader.LocalName == (object)id7_Name && (object)Reader.NamespaceURI == (object)id2_Item)) { { o.@Name = Reader.ReadElementString(); } paramsRead[1] = true; break; } if (!paramsRead[2] && ((object)Reader.LocalName == (object)id9_Description && (object)Reader.NamespaceURI == (object)id2_Item)) { { o.@Description = Reader.ReadElementString(); } paramsRead[2] = true; break; } UnknownNode((object)o, @":Id, :Name, :Description"); } while (false); } else { UnknownNode((object)o, @":Id, :Name, :Description"); } Reader.MoveToContent(); CheckReaderCount(ref whileIterations3, ref readerCount3); } ReadEndElement(); return(o); }