Esempio n. 1
0
 private CmdletOutputMetadata Read22_CmdletOutputMetadata(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.id29_CmdletOutputMetadata) || (type.Namespace != this.id2_Item)))
     {
         throw base.CreateUnknownTypeException(type);
     }
     if (flag)
     {
         return null;
     }
     CmdletOutputMetadata o = new CmdletOutputMetadata();
     bool[] flagArray = new bool[2];
     while (base.Reader.MoveToNextAttribute())
     {
         if ((!flagArray[1] && (base.Reader.LocalName == this.id48_PSName)) && (base.Reader.NamespaceURI == this.id4_Item))
         {
             o.PSName = base.Reader.Value;
             flagArray[1] = true;
         }
         else if (!base.IsXmlnsAttribute(base.Reader.Name))
         {
             base.UnknownNode(o, ":PSName");
         }
     }
     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.id90_ErrorCode)) && (base.Reader.NamespaceURI == this.id2_Item))
             {
                 o.ErrorCode = this.Read1_Object(false, true);
                 flagArray[0] = true;
             }
             else
             {
                 base.UnknownNode(o, "http://schemas.microsoft.com/cmdlets-over-objects/2009/11:ErrorCode");
             }
         }
         else
         {
             base.UnknownNode(o, "http://schemas.microsoft.com/cmdlets-over-objects/2009/11:ErrorCode");
         }
         base.Reader.MoveToContent();
         base.CheckReaderCount(ref whileIterations, ref readerCount);
     }
     base.ReadEndElement();
     return o;
 }
Esempio n. 2
0
 private void Write22_CmdletOutputMetadata(string n, string ns, CmdletOutputMetadata o, bool isNullable, bool needType)
 {
     if (o == null)
     {
         if (isNullable)
         {
             base.WriteNullTagLiteral(n, ns);
         }
     }
     else
     {
         if (!needType && !(o.GetType() == typeof(CmdletOutputMetadata)))
         {
             throw base.CreateUnknownTypeException(o);
         }
         base.WriteStartElement(n, ns, o, false, null);
         if (needType)
         {
             base.WriteXsiType("CmdletOutputMetadata", "http://schemas.microsoft.com/cmdlets-over-objects/2009/11");
         }
         base.WriteAttribute("PSName", "", o.PSName);
         this.Write1_Object("ErrorCode", "http://schemas.microsoft.com/cmdlets-over-objects/2009/11", o.ErrorCode, false, false);
         base.WriteEndElement(o);
     }
 }