Пример #1
0
 private string GetMethodParameterSet(CommonMethodMetadata methodMetadata)
 {
     int count;
     if (!this._staticMethodMetadataToUniqueId.TryGetValue(methodMetadata, out count))
     {
         count = this._staticMethodMetadataToUniqueId.Count;
         this._staticMethodMetadataToUniqueId.Add(methodMetadata, count);
     }
     return (methodMetadata.MethodName + count);
 }
Пример #2
0
 private void Write28_CommonMethodMetadata(string n, string ns, CommonMethodMetadata o, bool isNullable, bool needType)
 {
     if (o == null)
     {
         if (isNullable)
         {
             base.WriteNullTagLiteral(n, ns);
         }
     }
     else
     {
         if (!needType)
         {
             Type type = o.GetType();
             if (type != typeof(CommonMethodMetadata))
             {
                 if (type == typeof(InstanceMethodMetadata))
                 {
                     this.Write29_InstanceMethodMetadata(n, ns, (InstanceMethodMetadata) o, isNullable, true);
                     return;
                 }
                 if (type != typeof(StaticMethodMetadata))
                 {
                     throw base.CreateUnknownTypeException(o);
                 }
                 this.Write27_StaticMethodMetadata(n, ns, (StaticMethodMetadata) o, isNullable, true);
                 return;
             }
         }
         base.WriteStartElement(n, ns, o, false, null);
         if (needType)
         {
             base.WriteXsiType("CommonMethodMetadata", "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);
         base.WriteEndElement(o);
     }
 }
Пример #3
0
 private CommonMethodMetadata Read28_CommonMethodMetadata(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.id25_CommonMethodMetadata) || (type.Namespace != this.id2_Item)))
     {
         if ((type.Name == this.id32_InstanceMethodMetadata) && (type.Namespace == this.id2_Item))
         {
             return this.Read29_InstanceMethodMetadata(isNullable, false);
         }
         if ((type.Name != this.id26_StaticMethodMetadata) || (type.Namespace != this.id2_Item))
         {
             throw base.CreateUnknownTypeException(type);
         }
         return this.Read27_StaticMethodMetadata(isNullable, false);
     }
     if (flag)
     {
         return null;
     }
     CommonMethodMetadata o = new CommonMethodMetadata();
     bool[] flagArray = new bool[2];
     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
             {
                 base.UnknownNode(o, "http://schemas.microsoft.com/cmdlets-over-objects/2009/11:ReturnValue");
             }
         }
         else
         {
             base.UnknownNode(o, "http://schemas.microsoft.com/cmdlets-over-objects/2009/11:ReturnValue");
         }
         base.Reader.MoveToContent();
         base.CheckReaderCount(ref whileIterations, ref readerCount);
     }
     base.ReadEndElement();
     return o;
 }
Пример #4
0
        private string GetMethodParameterSet(CommonMethodMetadata methodMetadata)
        {
            Dbg.Assert(methodMetadata != null, "Caller should verify that instanceMethod != null");

            int uniqueId;
            if (!_staticMethodMetadataToUniqueId.TryGetValue(methodMetadata, out uniqueId))
            {
                uniqueId = _staticMethodMetadataToUniqueId.Count;
                _staticMethodMetadataToUniqueId.Add(methodMetadata, uniqueId);
            }

            return methodMetadata.MethodName + uniqueId;
        }