void Write12_CiscoIPPhoneIconMenuItemType(string n, string ns, CiscoIPPhoneIconMenuItemType 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(CiscoIPPhoneIconMenuItemType)) { } else { throw CreateUnknownTypeException(o); } } WriteStartElement(n, ns, o, false, null); if (needType) WriteXsiType(@"CiscoIPPhoneIconMenuItemType", @""); WriteNullableStringLiteral(@"Name", @"", ((global::System.String)o.@Name)); WriteNullableStringLiteral(@"URL", @"", ((global::System.String)o.@URL)); WriteElementStringRaw(@"IconIndex", @"", System.Xml.XmlConvert.ToString((global::System.Int16)((global::System.Int16)o.@IconIndex))); WriteEndElement(o); }
CiscoIPPhoneIconMenuItemType Read12_CiscoIPPhoneIconMenuItemType(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_CiscoIPPhoneIconMenuItemType && (object) ((System.Xml.XmlQualifiedName)xsiType).Namespace == (object)id2_Item)) { } else throw CreateUnknownTypeException((System.Xml.XmlQualifiedName)xsiType); } if (isNull) return null; CiscoIPPhoneIconMenuItemType o; o = new CiscoIPPhoneIconMenuItemType(); 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 whileIterations19 = 0; int readerCount19 = 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)id46_Name && (object) Reader.NamespaceURI == (object)id2_Item)) { if (ReadNull()) { o.@Name = null; } else { o.@Name = Reader.ReadElementString(); } paramsRead[0] = true; } else if (!paramsRead[1] && ((object) Reader.LocalName == (object)id38_URL && (object) Reader.NamespaceURI == (object)id2_Item)) { if (ReadNull()) { o.@URL = null; } else { o.@URL = Reader.ReadElementString(); } paramsRead[1] = true; } else if (!paramsRead[2] && ((object) Reader.LocalName == (object)id70_IconIndex && (object) Reader.NamespaceURI == (object)id2_Item)) { { o.@IconIndex = System.Xml.XmlConvert.ToInt16(Reader.ReadElementString()); } paramsRead[2] = true; } else { UnknownNode((object)o, @":Name, :URL, :IconIndex"); } } else { UnknownNode((object)o, @":Name, :URL, :IconIndex"); } Reader.MoveToContent(); CheckReaderCount(ref whileIterations19, ref readerCount19); } ReadEndElement(); return o; }