void Write13_CiscoIPPhoneImageType(string n, string ns, CiscoIPPhoneImageType 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(CiscoIPPhoneImageType)) { } else { throw CreateUnknownTypeException(o); } } WriteStartElement(n, ns, o, false, null); if (needType) WriteXsiType(@"CiscoIPPhoneImageType", @""); WriteNullableStringLiteral(@"Title", @"", ((global::System.String)o.@Title)); WriteNullableStringLiteral(@"Prompt", @"", ((global::System.String)o.@Prompt)); if (o.@LocationXSpecified) { WriteElementStringRaw(@"LocationX", @"", System.Xml.XmlConvert.ToString((global::System.Int16)((global::System.Int16)o.@LocationX))); } if (o.@LocationYSpecified) { WriteElementStringRaw(@"LocationY", @"", System.Xml.XmlConvert.ToString((global::System.Int16)((global::System.Int16)o.@LocationY))); } 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))); { CiscoIPPhoneSoftKeyType[] a = (CiscoIPPhoneSoftKeyType[])o.@SoftKeyItem; if (a != null) { for (int ia = 0; ia < a.Length; ia++) { Write3_CiscoIPPhoneSoftKeyType(@"SoftKeyItem", @"", ((CiscoIPPhoneSoftKeyType)a[ia]), false, false); } } } WriteEndElement(o); }
CiscoIPPhoneImageType Read13_CiscoIPPhoneImageType(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)id72_CiscoIPPhoneImageType && (object) ((System.Xml.XmlQualifiedName)xsiType).Namespace == (object)id2_Item)) { } else throw CreateUnknownTypeException((System.Xml.XmlQualifiedName)xsiType); } if (isNull) return null; CiscoIPPhoneImageType o; o = new CiscoIPPhoneImageType(); CiscoIPPhoneSoftKeyType[] a_8 = null; int ca_8 = 0; bool[] paramsRead = new bool[9]; while (Reader.MoveToNextAttribute()) { if (!IsXmlnsAttribute(Reader.Name)) { UnknownNode((object)o); } } Reader.MoveToElement(); if (Reader.IsEmptyElement) { Reader.Skip(); o.@SoftKeyItem = (CiscoIPPhoneSoftKeyType[])ShrinkArray(a_8, ca_8, typeof(CiscoIPPhoneSoftKeyType), true); return o; } Reader.ReadStartElement(); Reader.MoveToContent(); int whileIterations21 = 0; int readerCount21 = 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)id43_Title && (object) Reader.NamespaceURI == (object)id2_Item)) { if (ReadNull()) { o.@Title = null; } else { o.@Title = Reader.ReadElementString(); } paramsRead[0] = true; } else if (!paramsRead[1] && ((object) Reader.LocalName == (object)id44_Prompt && (object) Reader.NamespaceURI == (object)id2_Item)) { if (ReadNull()) { o.@Prompt = null; } else { o.@Prompt = Reader.ReadElementString(); } paramsRead[1] = true; } else if (!paramsRead[2] && ((object) Reader.LocalName == (object)id28_LocationX && (object) Reader.NamespaceURI == (object)id2_Item)) { o.@LocationXSpecified = true; { o.@LocationX = System.Xml.XmlConvert.ToInt16(Reader.ReadElementString()); } paramsRead[2] = true; } else if (!paramsRead[3] && ((object) Reader.LocalName == (object)id29_LocationY && (object) Reader.NamespaceURI == (object)id2_Item)) { o.@LocationYSpecified = true; { o.@LocationY = System.Xml.XmlConvert.ToInt16(Reader.ReadElementString()); } paramsRead[3] = true; } else if (!paramsRead[4] && ((object) Reader.LocalName == (object)id30_Width && (object) Reader.NamespaceURI == (object)id2_Item)) { { o.@Width = System.Xml.XmlConvert.ToUInt16(Reader.ReadElementString()); } paramsRead[4] = true; } else if (!paramsRead[5] && ((object) Reader.LocalName == (object)id31_Height && (object) Reader.NamespaceURI == (object)id2_Item)) { { o.@Height = System.Xml.XmlConvert.ToUInt16(Reader.ReadElementString()); } paramsRead[5] = true; } else if (!paramsRead[6] && ((object) Reader.LocalName == (object)id32_Depth && (object) Reader.NamespaceURI == (object)id2_Item)) { { o.@Depth = System.Xml.XmlConvert.ToUInt16(Reader.ReadElementString()); } paramsRead[6] = true; } else if (!paramsRead[7] && ((object) Reader.LocalName == (object)id33_Data && (object) Reader.NamespaceURI == (object)id2_Item)) { { o.@Data = ToByteArrayHex(false); } paramsRead[7] = true; } else if (((object) Reader.LocalName == (object)id51_SoftKeyItem && (object) Reader.NamespaceURI == (object)id2_Item)) { a_8 = (CiscoIPPhoneSoftKeyType[])EnsureArrayIndex(a_8, ca_8, typeof(CiscoIPPhoneSoftKeyType));a_8[ca_8++] = Read3_CiscoIPPhoneSoftKeyType(false, true); } else { UnknownNode((object)o, @":Title, :Prompt, :LocationX, :LocationY, :Width, :Height, :Depth, :Data, :SoftKeyItem"); } } else { UnknownNode((object)o, @":Title, :Prompt, :LocationX, :LocationY, :Width, :Height, :Depth, :Data, :SoftKeyItem"); } Reader.MoveToContent(); CheckReaderCount(ref whileIterations21, ref readerCount21); } o.@SoftKeyItem = (CiscoIPPhoneSoftKeyType[])ShrinkArray(a_8, ca_8, typeof(CiscoIPPhoneSoftKeyType), true); ReadEndElement(); return o; }