Esempio n. 1
0
        private SetupComponentInfo Read12_SetupComponentInfo(bool isNullable, bool checkType)
        {
            XmlQualifiedName xmlQualifiedName = checkType ? base.GetXsiType() : null;
            bool             flag             = false;

            if (isNullable)
            {
                flag = base.ReadNull();
            }
            if (checkType && !(xmlQualifiedName == null) && (xmlQualifiedName.Name != this.id1_SetupComponentInfo || xmlQualifiedName.Namespace != this.id2_Item))
            {
                throw base.CreateUnknownTypeException(xmlQualifiedName);
            }
            if (flag)
            {
                return(null);
            }
            SetupComponentInfo setupComponentInfo = new SetupComponentInfo();

            if (setupComponentInfo.ServerTasks == null)
            {
                setupComponentInfo.ServerTasks = new ServerTaskInfoCollection();
            }
            ServerTaskInfoCollection serverTasks = setupComponentInfo.ServerTasks;

            if (setupComponentInfo.OrgTasks == null)
            {
                setupComponentInfo.OrgTasks = new OrgTaskInfoCollection();
            }
            OrgTaskInfoCollection orgTasks = setupComponentInfo.OrgTasks;

            if (setupComponentInfo.ServicePlanOrgTasks == null)
            {
                setupComponentInfo.ServicePlanOrgTasks = new ServicePlanTaskInfoCollection();
            }
            ServicePlanTaskInfoCollection servicePlanOrgTasks = setupComponentInfo.ServicePlanOrgTasks;
            TaskInfoCollection            tasks = setupComponentInfo.Tasks;

            bool[] array = new bool[12];
            while (base.Reader.MoveToNextAttribute())
            {
                if (!array[0] && base.Reader.LocalName == this.id3_Name && base.Reader.NamespaceURI == this.id2_Item)
                {
                    setupComponentInfo.Name = base.Reader.Value;
                    array[0] = true;
                }
                else if (!array[1] && base.Reader.LocalName == this.id4_AlwaysExecute && base.Reader.NamespaceURI == this.id2_Item)
                {
                    setupComponentInfo.AlwaysExecute = XmlConvert.ToBoolean(base.Reader.Value);
                    array[1] = true;
                }
                else if (!array[2] && base.Reader.LocalName == this.id5_IsDatacenterOnly && base.Reader.NamespaceURI == this.id2_Item)
                {
                    setupComponentInfo.IsDatacenterOnly = XmlConvert.ToBoolean(base.Reader.Value);
                    array[2] = true;
                }
                else if (!array[3] && base.Reader.LocalName == this.id6_DescriptionId && base.Reader.NamespaceURI == this.id2_Item)
                {
                    setupComponentInfo.DescriptionId = base.Reader.Value;
                    array[3] = true;
                }
                else if (!array[4] && base.Reader.LocalName == this.id50_IsPartnerHostedOnly && base.Reader.NamespaceURI == this.id2_Item)
                {
                    setupComponentInfo.IsPartnerHostedOnly = XmlConvert.ToBoolean(base.Reader.Value);
                    array[4] = true;
                }
                else if (!array[5] && base.Reader.LocalName == this.id22_DatacenterMode && base.Reader.NamespaceURI == this.id2_Item)
                {
                    setupComponentInfo.DatacenterMode = this.Read14_DatacenterMode(base.Reader.Value);
                    array[5] = true;
                }
                else if (!array[6] && base.Reader.LocalName == this.id55_IsDatacenterDedicatedOnly && base.Reader.NamespaceURI == this.id2_Item)
                {
                    setupComponentInfo.IsDatacenterDedicatedOnly = XmlConvert.ToBoolean(base.Reader.Value);
                    array[6] = true;
                }
                else if (!base.IsXmlnsAttribute(base.Reader.Name))
                {
                    base.UnknownNode(setupComponentInfo, ":Name, :AlwaysExecute, :IsDatacenterOnly, :DescriptionId, :IsPartnerHostedOnly, :IsDatacenterDedicatedOnly");
                }
            }
            base.Reader.MoveToElement();
            if (base.Reader.IsEmptyElement)
            {
                base.Reader.Skip();
                return(setupComponentInfo);
            }
            base.Reader.ReadStartElement();
            base.Reader.MoveToContent();
            int num         = 0;
            int readerCount = base.ReaderCount;

            while (base.Reader.NodeType != XmlNodeType.EndElement && base.Reader.NodeType != XmlNodeType.None)
            {
                if (base.Reader.NodeType == XmlNodeType.Element)
                {
                    if (base.Reader.LocalName == this.id7_ServerTasks && base.Reader.NamespaceURI == this.id2_Item)
                    {
                        if (!base.ReadNull())
                        {
                            if (setupComponentInfo.ServerTasks == null)
                            {
                                setupComponentInfo.ServerTasks = new ServerTaskInfoCollection();
                            }
                            ServerTaskInfoCollection serverTasks2 = setupComponentInfo.ServerTasks;
                            if (base.Reader.IsEmptyElement)
                            {
                                base.Reader.Skip();
                            }
                            else
                            {
                                base.Reader.ReadStartElement();
                                base.Reader.MoveToContent();
                                int num2         = 0;
                                int readerCount2 = base.ReaderCount;
                                while (base.Reader.NodeType != XmlNodeType.EndElement && base.Reader.NodeType != XmlNodeType.None)
                                {
                                    if (base.Reader.NodeType == XmlNodeType.Element)
                                    {
                                        if (base.Reader.LocalName == this.id8_ServerTaskInfo && base.Reader.NamespaceURI == this.id2_Item)
                                        {
                                            if (serverTasks2 == null)
                                            {
                                                base.Reader.Skip();
                                            }
                                            else
                                            {
                                                serverTasks2.Add(this.Read7_ServerTaskInfo(true, true));
                                            }
                                        }
                                        else
                                        {
                                            base.UnknownNode(null, ":ServerTaskInfo");
                                        }
                                    }
                                    else
                                    {
                                        base.UnknownNode(null, ":ServerTaskInfo");
                                    }
                                    base.Reader.MoveToContent();
                                    base.CheckReaderCount(ref num2, ref readerCount2);
                                }
                                base.ReadEndElement();
                            }
                        }
                    }
                    else if (base.Reader.LocalName == this.id9_OrgTasks && base.Reader.NamespaceURI == this.id2_Item)
                    {
                        if (!base.ReadNull())
                        {
                            if (setupComponentInfo.OrgTasks == null)
                            {
                                setupComponentInfo.OrgTasks = new OrgTaskInfoCollection();
                            }
                            OrgTaskInfoCollection orgTasks2 = setupComponentInfo.OrgTasks;
                            if (base.Reader.IsEmptyElement)
                            {
                                base.Reader.Skip();
                            }
                            else
                            {
                                base.Reader.ReadStartElement();
                                base.Reader.MoveToContent();
                                int num3         = 0;
                                int readerCount3 = base.ReaderCount;
                                while (base.Reader.NodeType != XmlNodeType.EndElement && base.Reader.NodeType != XmlNodeType.None)
                                {
                                    if (base.Reader.NodeType == XmlNodeType.Element)
                                    {
                                        if (base.Reader.LocalName == this.id10_OrgTaskInfo && base.Reader.NamespaceURI == this.id2_Item)
                                        {
                                            if (orgTasks2 == null)
                                            {
                                                base.Reader.Skip();
                                            }
                                            else
                                            {
                                                orgTasks2.Add(this.Read10_OrgTaskInfo(true, true));
                                            }
                                        }
                                        else if (base.Reader.LocalName == this.id12_ServicePlanTaskInfo && base.Reader.NamespaceURI == this.id2_Item)
                                        {
                                            if (orgTasks2 == null)
                                            {
                                                base.Reader.Skip();
                                            }
                                            else
                                            {
                                                orgTasks2.Add(this.Read11_ServicePlanTaskInfo(true, true));
                                            }
                                        }
                                        else
                                        {
                                            base.UnknownNode(null, ":OrgTaskInfo");
                                        }
                                    }
                                    else
                                    {
                                        base.UnknownNode(null, ":OrgTaskInfo");
                                    }
                                    base.Reader.MoveToContent();
                                    base.CheckReaderCount(ref num3, ref readerCount3);
                                }
                                base.ReadEndElement();
                            }
                        }
                    }
                    else if (base.Reader.LocalName == this.id11_ServicePlanOrgTasks && base.Reader.NamespaceURI == this.id2_Item)
                    {
                        if (!base.ReadNull())
                        {
                            if (setupComponentInfo.ServicePlanOrgTasks == null)
                            {
                                setupComponentInfo.ServicePlanOrgTasks = new ServicePlanTaskInfoCollection();
                            }
                            ServicePlanTaskInfoCollection servicePlanOrgTasks2 = setupComponentInfo.ServicePlanOrgTasks;
                            if (base.Reader.IsEmptyElement)
                            {
                                base.Reader.Skip();
                            }
                            else
                            {
                                base.Reader.ReadStartElement();
                                base.Reader.MoveToContent();
                                int num4         = 0;
                                int readerCount4 = base.ReaderCount;
                                while (base.Reader.NodeType != XmlNodeType.EndElement && base.Reader.NodeType != XmlNodeType.None)
                                {
                                    if (base.Reader.NodeType == XmlNodeType.Element)
                                    {
                                        if (base.Reader.LocalName == this.id12_ServicePlanTaskInfo && base.Reader.NamespaceURI == this.id2_Item)
                                        {
                                            if (servicePlanOrgTasks2 == null)
                                            {
                                                base.Reader.Skip();
                                            }
                                            else
                                            {
                                                servicePlanOrgTasks2.Add(this.Read11_ServicePlanTaskInfo(true, true));
                                            }
                                        }
                                        else
                                        {
                                            base.UnknownNode(null, ":ServicePlanTaskInfo");
                                        }
                                    }
                                    else
                                    {
                                        base.UnknownNode(null, ":ServicePlanTaskInfo");
                                    }
                                    base.Reader.MoveToContent();
                                    base.CheckReaderCount(ref num4, ref readerCount4);
                                }
                                base.ReadEndElement();
                            }
                        }
                    }
                    else if (base.Reader.LocalName == this.id13_Tasks && base.Reader.NamespaceURI == this.id2_Item)
                    {
                        if (!base.ReadNull())
                        {
                            TaskInfoCollection tasks2 = setupComponentInfo.Tasks;
                            if (tasks2 == null || base.Reader.IsEmptyElement)
                            {
                                base.Reader.Skip();
                            }
                            else
                            {
                                base.Reader.ReadStartElement();
                                base.Reader.MoveToContent();
                                int num5         = 0;
                                int readerCount5 = base.ReaderCount;
                                while (base.Reader.NodeType != XmlNodeType.EndElement && base.Reader.NodeType != XmlNodeType.None)
                                {
                                    if (base.Reader.NodeType == XmlNodeType.Element)
                                    {
                                        if (base.Reader.LocalName == this.id14_TaskInfo && base.Reader.NamespaceURI == this.id2_Item)
                                        {
                                            if (tasks2 == null)
                                            {
                                                base.Reader.Skip();
                                            }
                                            else
                                            {
                                                tasks2.Add(this.Read2_TaskInfo(true, true));
                                            }
                                        }
                                        else
                                        {
                                            base.UnknownNode(null, ":TaskInfo");
                                        }
                                    }
                                    else
                                    {
                                        base.UnknownNode(null, ":TaskInfo");
                                    }
                                    base.Reader.MoveToContent();
                                    base.CheckReaderCount(ref num5, ref readerCount5);
                                }
                                base.ReadEndElement();
                            }
                        }
                    }
                    else
                    {
                        base.UnknownNode(setupComponentInfo, ":ServerTasks, :OrgTasks, :ServicePlanOrgTasks, :Tasks");
                    }
                }
                else
                {
                    base.UnknownNode(setupComponentInfo, ":ServerTasks, :OrgTasks, :ServicePlanOrgTasks, :Tasks");
                }
                base.Reader.MoveToContent();
                base.CheckReaderCount(ref num, ref readerCount);
            }
            base.ReadEndElement();
            return(setupComponentInfo);
        }
        private void Write12_SetupComponentInfo(string n, string ns, SetupComponentInfo o, bool isNullable, bool needType)
        {
            if (o == null)
            {
                if (isNullable)
                {
                    base.WriteNullTagLiteral(n, ns);
                }
                return;
            }
            if (!needType)
            {
                Type type = o.GetType();
                if (!(type == typeof(SetupComponentInfo)))
                {
                    throw base.CreateUnknownTypeException(o);
                }
            }
            base.WriteStartElement(n, ns, o, false, null);
            if (needType)
            {
                base.WriteXsiType("SetupComponentInfo", "");
            }
            base.WriteAttribute("Name", "", o.Name);
            base.WriteAttribute("AlwaysExecute", "", XmlConvert.ToString(o.AlwaysExecute));
            base.WriteAttribute("IsDatacenterOnly", "", XmlConvert.ToString(o.IsDatacenterOnly));
            base.WriteAttribute("IsDatacenterDedicatedOnly", "", XmlConvert.ToString(o.IsDatacenterDedicatedOnly));
            base.WriteAttribute("IsPartnerHostedOnly", "", XmlConvert.ToString(o.IsPartnerHostedOnly));
            if (o.DatacenterMode != DatacenterMode.Common)
            {
                base.WriteAttribute("DatacenterMode", "", this.Write14_DatacenterMode(o.DatacenterMode));
            }
            base.WriteAttribute("DescriptionId", "", o.DescriptionId);
            ServerTaskInfoCollection serverTasks = o.ServerTasks;

            if (serverTasks != null)
            {
                base.WriteStartElement("ServerTasks", "", null, false);
                for (int i = 0; i < ((ICollection)serverTasks).Count; i++)
                {
                    this.Write7_ServerTaskInfo("ServerTaskInfo", "", serverTasks[i], true, false);
                }
                base.WriteEndElement();
            }
            OrgTaskInfoCollection orgTasks = o.OrgTasks;

            if (orgTasks != null)
            {
                base.WriteStartElement("OrgTasks", "", null, false);
                for (int j = 0; j < ((ICollection)orgTasks).Count; j++)
                {
                    this.Write10_OrgTaskInfo("OrgTaskInfo", "", orgTasks[j], true, false);
                }
                base.WriteEndElement();
            }
            ServicePlanTaskInfoCollection servicePlanOrgTasks = o.ServicePlanOrgTasks;

            if (servicePlanOrgTasks != null)
            {
                base.WriteStartElement("ServicePlanOrgTasks", "", null, false);
                for (int k = 0; k < ((ICollection)servicePlanOrgTasks).Count; k++)
                {
                    this.Write11_ServicePlanTaskInfo("ServicePlanTaskInfo", "", servicePlanOrgTasks[k], true, false);
                }
                base.WriteEndElement();
            }
            TaskInfoCollection tasks = o.Tasks;

            if (tasks != null)
            {
                base.WriteStartElement("Tasks", "", null, false);
                for (int l = 0; l < ((ICollection)tasks).Count; l++)
                {
                    this.Write2_TaskInfo("TaskInfo", "", tasks[l], true, false);
                }
                base.WriteEndElement();
            }
            base.WriteEndElement(o);
        }