示例#1
0
 private InstanceMethodMetadata Read29_InstanceMethodMetadata(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.id32_InstanceMethodMetadata) || (type.Namespace != this.id2_Item)))
     {
         throw base.CreateUnknownTypeException(type);
     }
     if (flag)
     {
         return null;
     }
     InstanceMethodMetadata o = new InstanceMethodMetadata();
     bool[] flagArray = new bool[3];
     while (base.Reader.MoveToNextAttribute())
     {
         if ((!flagArray[1] && (base.Reader.LocalName == this.id83_MethodName)) && (base.Reader.NamespaceURI == this.id4_Item))
         {
             o.MethodName = base.Reader.Value;
             flagArray[1] = true;
         }
         else if (!base.IsXmlnsAttribute(base.Reader.Name))
         {
             base.UnknownNode(o, ":MethodName");
         }
     }
     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.id85_ReturnValue)) && (base.Reader.NamespaceURI == this.id2_Item))
             {
                 o.ReturnValue = this.Read23_Item(false, true);
                 flagArray[0] = true;
             }
             else if ((base.Reader.LocalName == this.id86_Parameters) && (base.Reader.NamespaceURI == this.id2_Item))
             {
                 if (!base.ReadNull())
                 {
                     InstanceMethodParameterMetadata[] a = null;
                     int index = 0;
                     if (base.Reader.IsEmptyElement)
                     {
                         base.Reader.Skip();
                     }
                     else
                     {
                         base.Reader.ReadStartElement();
                         base.Reader.MoveToContent();
                         int num4 = 0;
                         int num5 = base.ReaderCount;
                         while ((base.Reader.NodeType != XmlNodeType.EndElement) && (base.Reader.NodeType != XmlNodeType.None))
                         {
                             if (base.Reader.NodeType == XmlNodeType.Element)
                             {
                                 if ((base.Reader.LocalName == this.id73_Parameter) && (base.Reader.NamespaceURI == this.id2_Item))
                                 {
                                     a = (InstanceMethodParameterMetadata[]) base.EnsureArrayIndex(a, index, typeof(InstanceMethodParameterMetadata));
                                     a[index++] = this.Read24_Item(false, true);
                                 }
                                 else
                                 {
                                     base.UnknownNode(null, "http://schemas.microsoft.com/cmdlets-over-objects/2009/11:Parameter");
                                 }
                             }
                             else
                             {
                                 base.UnknownNode(null, "http://schemas.microsoft.com/cmdlets-over-objects/2009/11:Parameter");
                             }
                             base.Reader.MoveToContent();
                             base.CheckReaderCount(ref num4, ref num5);
                         }
                         base.ReadEndElement();
                     }
                     o.Parameters = (InstanceMethodParameterMetadata[]) base.ShrinkArray(a, index, typeof(InstanceMethodParameterMetadata), false);
                 }
             }
             else
             {
                 base.UnknownNode(o, "http://schemas.microsoft.com/cmdlets-over-objects/2009/11:ReturnValue, http://schemas.microsoft.com/cmdlets-over-objects/2009/11:Parameters");
             }
         }
         else
         {
             base.UnknownNode(o, "http://schemas.microsoft.com/cmdlets-over-objects/2009/11:ReturnValue, http://schemas.microsoft.com/cmdlets-over-objects/2009/11:Parameters");
         }
         base.Reader.MoveToContent();
         base.CheckReaderCount(ref whileIterations, ref readerCount);
     }
     base.ReadEndElement();
     return o;
 }
示例#2
0
 private void Write29_InstanceMethodMetadata(string n, string ns, InstanceMethodMetadata o, bool isNullable, bool needType)
 {
     if (o == null)
     {
         if (isNullable)
         {
             base.WriteNullTagLiteral(n, ns);
         }
     }
     else
     {
         if (!needType && !(o.GetType() == typeof(InstanceMethodMetadata)))
         {
             throw base.CreateUnknownTypeException(o);
         }
         base.WriteStartElement(n, ns, o, false, null);
         if (needType)
         {
             base.WriteXsiType("InstanceMethodMetadata", "http://schemas.microsoft.com/cmdlets-over-objects/2009/11");
         }
         base.WriteAttribute("MethodName", "", o.MethodName);
         this.Write23_Item("ReturnValue", "http://schemas.microsoft.com/cmdlets-over-objects/2009/11", o.ReturnValue, false, false);
         InstanceMethodParameterMetadata[] parameters = o.Parameters;
         if (parameters != null)
         {
             base.WriteStartElement("Parameters", "http://schemas.microsoft.com/cmdlets-over-objects/2009/11", null, false);
             for (int i = 0; i < parameters.Length; i++)
             {
                 this.Write24_Item("Parameter", "http://schemas.microsoft.com/cmdlets-over-objects/2009/11", parameters[i], false, false);
             }
             base.WriteEndElement();
         }
         base.WriteEndElement(o);
     }
 }