void Write14_CiscoIPPhoneImageFileType(string n, string ns, CiscoIPPhoneImageFileType 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(CiscoIPPhoneImageFileType)) { } else { throw CreateUnknownTypeException(o); } } WriteStartElement(n, ns, o, false, null); if (needType) WriteXsiType(@"CiscoIPPhoneImageFileType", @""); WriteElementString(@"Title", @"", ((global::System.String)o.@Title)); WriteElementString(@"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))); } WriteElementString(@"URL", @"", ((global::System.String)o.@URL)); { 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); }
CiscoIPPhoneImageFileType Read14_CiscoIPPhoneImageFileType(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)id71_CiscoIPPhoneImageFileType && (object) ((System.Xml.XmlQualifiedName)xsiType).Namespace == (object)id2_Item)) { } else throw CreateUnknownTypeException((System.Xml.XmlQualifiedName)xsiType); } if (isNull) return null; CiscoIPPhoneImageFileType o; o = new CiscoIPPhoneImageFileType(); CiscoIPPhoneSoftKeyType[] a_5 = null; int ca_5 = 0; bool[] paramsRead = new bool[6]; while (Reader.MoveToNextAttribute()) { if (!IsXmlnsAttribute(Reader.Name)) { UnknownNode((object)o); } } Reader.MoveToElement(); if (Reader.IsEmptyElement) { Reader.Skip(); o.@SoftKeyItem = (CiscoIPPhoneSoftKeyType[])ShrinkArray(a_5, ca_5, typeof(CiscoIPPhoneSoftKeyType), true); return o; } Reader.ReadStartElement(); Reader.MoveToContent(); int whileIterations20 = 0; int readerCount20 = 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)) { { o.@Title = Reader.ReadElementString(); } paramsRead[0] = true; } else if (!paramsRead[1] && ((object) Reader.LocalName == (object)id44_Prompt && (object) Reader.NamespaceURI == (object)id2_Item)) { { 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)id38_URL && (object) Reader.NamespaceURI == (object)id2_Item)) { { o.@URL = Reader.ReadElementString(); } paramsRead[4] = true; } else if (((object) Reader.LocalName == (object)id51_SoftKeyItem && (object) Reader.NamespaceURI == (object)id2_Item)) { a_5 = (CiscoIPPhoneSoftKeyType[])EnsureArrayIndex(a_5, ca_5, typeof(CiscoIPPhoneSoftKeyType));a_5[ca_5++] = Read3_CiscoIPPhoneSoftKeyType(false, true); } else { UnknownNode((object)o, @":Title, :Prompt, :LocationX, :LocationY, :URL, :SoftKeyItem"); } } else { UnknownNode((object)o, @":Title, :Prompt, :LocationX, :LocationY, :URL, :SoftKeyItem"); } Reader.MoveToContent(); CheckReaderCount(ref whileIterations20, ref readerCount20); } o.@SoftKeyItem = (CiscoIPPhoneSoftKeyType[])ShrinkArray(a_5, ca_5, typeof(CiscoIPPhoneSoftKeyType), true); ReadEndElement(); return o; }