Пример #1
0
 private GetCmdletMetadata Read21_GetCmdletMetadata(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.id20_GetCmdletMetadata) || (type.Namespace != this.id2_Item)))
     {
         throw base.CreateUnknownTypeException(type);
     }
     if (flag)
     {
         return null;
     }
     GetCmdletMetadata o = new GetCmdletMetadata();
     bool[] flagArray = new bool[2];
     while (base.Reader.MoveToNextAttribute())
     {
         if (!base.IsXmlnsAttribute(base.Reader.Name))
         {
             base.UnknownNode(o);
         }
     }
     base.Reader.MoveToElement();
     if (base.Reader.IsEmptyElement)
     {
         base.Reader.Skip();
         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.id81_CmdletMetadata)) && (base.Reader.NamespaceURI == this.id2_Item))
             {
                 o.CmdletMetadata = this.Read20_CommonCmdletMetadata(false, true);
                 flagArray[0] = true;
             }
             else if ((!flagArray[1] && (base.Reader.LocalName == this.id6_GetCmdletParameters)) && (base.Reader.NamespaceURI == this.id2_Item))
             {
                 o.GetCmdletParameters = this.Read18_GetCmdletParameters(false, true);
                 flagArray[1] = true;
             }
             else
             {
                 base.UnknownNode(o, "http://schemas.microsoft.com/cmdlets-over-objects/2009/11:CmdletMetadata, http://schemas.microsoft.com/cmdlets-over-objects/2009/11:GetCmdletParameters");
             }
         }
         else
         {
             base.UnknownNode(o, "http://schemas.microsoft.com/cmdlets-over-objects/2009/11:CmdletMetadata, http://schemas.microsoft.com/cmdlets-over-objects/2009/11:GetCmdletParameters");
         }
         base.Reader.MoveToContent();
         base.CheckReaderCount(ref whileIterations, ref readerCount);
     }
     base.ReadEndElement();
     return o;
 }
Пример #2
0
 private void Write21_GetCmdletMetadata(string n, string ns, GetCmdletMetadata o, bool isNullable, bool needType)
 {
     if (o == null)
     {
         if (isNullable)
         {
             base.WriteNullTagLiteral(n, ns);
         }
     }
     else
     {
         if (!needType && !(o.GetType() == typeof(GetCmdletMetadata)))
         {
             throw base.CreateUnknownTypeException(o);
         }
         base.WriteStartElement(n, ns, o, false, null);
         if (needType)
         {
             base.WriteXsiType("GetCmdletMetadata", "http://schemas.microsoft.com/cmdlets-over-objects/2009/11");
         }
         this.Write20_CommonCmdletMetadata("CmdletMetadata", "http://schemas.microsoft.com/cmdlets-over-objects/2009/11", o.CmdletMetadata, false, false);
         this.Write18_GetCmdletParameters("GetCmdletParameters", "http://schemas.microsoft.com/cmdlets-over-objects/2009/11", o.GetCmdletParameters, false, false);
         base.WriteEndElement(o);
     }
 }