void Write11_CiscoIPPhoneIconItemType(string n, string ns, CiscoIPPhoneIconItemType 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(CiscoIPPhoneIconItemType)) { } else { throw CreateUnknownTypeException(o); } } WriteStartElement(n, ns, o, false, null); if (needType) WriteXsiType(@"CiscoIPPhoneIconItemType", @""); WriteElementStringRaw(@"Index", @"", System.Xml.XmlConvert.ToString((global::System.Int16)((global::System.Int16)o.@Index))); WriteElementStringRaw(@"Width", @"", System.Xml.XmlConvert.ToString((global::System.UInt16)((global::System.UInt16)o.@Width))); WriteElementStringRaw(@"Height", @"", System.Xml.XmlConvert.ToString((global::System.UInt16)((global::System.UInt16)o.@Height))); WriteElementStringRaw(@"Depth", @"", System.Xml.XmlConvert.ToString((global::System.UInt16)((global::System.UInt16)o.@Depth))); WriteElementStringRaw(@"Data", @"", FromByteArrayHex(((global::System.Byte[])o.@Data))); WriteEndElement(o); }
CiscoIPPhoneIconItemType Read11_CiscoIPPhoneIconItemType(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)id10_CiscoIPPhoneIconItemType && (object) ((System.Xml.XmlQualifiedName)xsiType).Namespace == (object)id2_Item)) { } else throw CreateUnknownTypeException((System.Xml.XmlQualifiedName)xsiType); } if (isNull) return null; CiscoIPPhoneIconItemType o; o = new CiscoIPPhoneIconItemType(); bool[] paramsRead = new bool[5]; while (Reader.MoveToNextAttribute()) { if (!IsXmlnsAttribute(Reader.Name)) { UnknownNode((object)o); } } Reader.MoveToElement(); if (Reader.IsEmptyElement) { Reader.Skip(); return o; } Reader.ReadStartElement(); Reader.MoveToContent(); int whileIterations18 = 0; int readerCount18 = 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)id69_Index && (object) Reader.NamespaceURI == (object)id2_Item)) { { o.@Index = System.Xml.XmlConvert.ToInt16(Reader.ReadElementString()); } paramsRead[0] = true; } else if (!paramsRead[1] && ((object) Reader.LocalName == (object)id30_Width && (object) Reader.NamespaceURI == (object)id2_Item)) { { o.@Width = System.Xml.XmlConvert.ToUInt16(Reader.ReadElementString()); } paramsRead[1] = true; } else if (!paramsRead[2] && ((object) Reader.LocalName == (object)id31_Height && (object) Reader.NamespaceURI == (object)id2_Item)) { { o.@Height = System.Xml.XmlConvert.ToUInt16(Reader.ReadElementString()); } paramsRead[2] = true; } else if (!paramsRead[3] && ((object) Reader.LocalName == (object)id32_Depth && (object) Reader.NamespaceURI == (object)id2_Item)) { { o.@Depth = System.Xml.XmlConvert.ToUInt16(Reader.ReadElementString()); } paramsRead[3] = true; } else if (!paramsRead[4] && ((object) Reader.LocalName == (object)id33_Data && (object) Reader.NamespaceURI == (object)id2_Item)) { { o.@Data = ToByteArrayHex(false); } paramsRead[4] = true; } else { UnknownNode((object)o, @":Index, :Width, :Height, :Depth, :Data"); } } else { UnknownNode((object)o, @":Index, :Width, :Height, :Depth, :Data"); } Reader.MoveToContent(); CheckReaderCount(ref whileIterations18, ref readerCount18); } ReadEndElement(); return o; }