示例#1
0
 private ClassMetadataInstanceCmdlets Read39_ClassMetadataInstanceCmdlets(bool isNullable, bool checkType)
 {
     XmlQualifiedName type = checkType ? base.GetXsiType() : null;
     bool flag = false;
     if (isNullable)
     {
         flag = base.ReadNull();
     }
     if ((checkType && (type != null)) && ((type.Name != this.id5_ClassMetadataInstanceCmdlets) || (type.Namespace != this.id2_Item)))
     {
         throw base.CreateUnknownTypeException(type);
     }
     if (flag)
     {
         return null;
     }
     ClassMetadataInstanceCmdlets o = new ClassMetadataInstanceCmdlets();
     InstanceCmdletMetadata[] a = null;
     int length = 0;
     bool[] flagArray = new bool[3];
     while (base.Reader.MoveToNextAttribute())
     {
         if (!base.IsXmlnsAttribute(base.Reader.Name))
         {
             base.UnknownNode(o);
         }
     }
     base.Reader.MoveToElement();
     if (base.Reader.IsEmptyElement)
     {
         base.Reader.Skip();
         o.Cmdlet = (InstanceCmdletMetadata[]) base.ShrinkArray(a, length, typeof(InstanceCmdletMetadata), true);
         return o;
     }
     base.Reader.ReadStartElement();
     base.Reader.MoveToContent();
     int whileIterations = 0;
     int readerCount = base.ReaderCount;
     while ((base.Reader.NodeType != XmlNodeType.EndElement) && (base.Reader.NodeType != XmlNodeType.None))
     {
         if (base.Reader.NodeType == XmlNodeType.Element)
         {
             if ((!flagArray[0] && (base.Reader.LocalName == this.id6_GetCmdletParameters)) && (base.Reader.NamespaceURI == this.id2_Item))
             {
                 o.GetCmdletParameters = this.Read18_GetCmdletParameters(false, true);
                 flagArray[0] = true;
             }
             else if ((!flagArray[1] && (base.Reader.LocalName == this.id117_GetCmdlet)) && (base.Reader.NamespaceURI == this.id2_Item))
             {
                 o.GetCmdlet = this.Read21_GetCmdletMetadata(false, true);
                 flagArray[1] = true;
             }
             else if ((base.Reader.LocalName == this.id76_Cmdlet) && (base.Reader.NamespaceURI == this.id2_Item))
             {
                 a = (InstanceCmdletMetadata[]) base.EnsureArrayIndex(a, length, typeof(InstanceCmdletMetadata));
                 a[length++] = this.Read30_InstanceCmdletMetadata(false, true);
             }
             else
             {
                 base.UnknownNode(o, "http://schemas.microsoft.com/cmdlets-over-objects/2009/11:GetCmdletParameters, http://schemas.microsoft.com/cmdlets-over-objects/2009/11:GetCmdlet, http://schemas.microsoft.com/cmdlets-over-objects/2009/11:Cmdlet");
             }
         }
         else
         {
             base.UnknownNode(o, "http://schemas.microsoft.com/cmdlets-over-objects/2009/11:GetCmdletParameters, http://schemas.microsoft.com/cmdlets-over-objects/2009/11:GetCmdlet, http://schemas.microsoft.com/cmdlets-over-objects/2009/11:Cmdlet");
         }
         base.Reader.MoveToContent();
         base.CheckReaderCount(ref whileIterations, ref readerCount);
     }
     o.Cmdlet = (InstanceCmdletMetadata[]) base.ShrinkArray(a, length, typeof(InstanceCmdletMetadata), true);
     base.ReadEndElement();
     return o;
 }
示例#2
0
 private void Write39_ClassMetadataInstanceCmdlets(string n, string ns, ClassMetadataInstanceCmdlets o, bool isNullable, bool needType)
 {
     if (o == null)
     {
         if (isNullable)
         {
             base.WriteNullTagLiteral(n, ns);
         }
     }
     else
     {
         if (!needType && !(o.GetType() == typeof(ClassMetadataInstanceCmdlets)))
         {
             throw base.CreateUnknownTypeException(o);
         }
         base.WriteStartElement(n, ns, o, false, null);
         if (needType)
         {
             base.WriteXsiType("ClassMetadataInstanceCmdlets", "http://schemas.microsoft.com/cmdlets-over-objects/2009/11");
         }
         this.Write18_GetCmdletParameters("GetCmdletParameters", "http://schemas.microsoft.com/cmdlets-over-objects/2009/11", o.GetCmdletParameters, false, false);
         this.Write21_GetCmdletMetadata("GetCmdlet", "http://schemas.microsoft.com/cmdlets-over-objects/2009/11", o.GetCmdlet, false, false);
         InstanceCmdletMetadata[] cmdlet = o.Cmdlet;
         if (cmdlet != null)
         {
             for (int i = 0; i < cmdlet.Length; i++)
             {
                 this.Write30_InstanceCmdletMetadata("Cmdlet", "http://schemas.microsoft.com/cmdlets-over-objects/2009/11", cmdlet[i], false, false);
             }
         }
         base.WriteEndElement(o);
     }
 }