Example #1
0
 internal static void GetHeaderMembers(SoapHeaderCollection headers, object target, SoapHeaderMapping[] mappings, SoapHeaderDirection direction, bool client)
 {
     for (int i = 0; i < mappings.Length; i++)
     {
         SoapHeaderMapping mapping = mappings[i];
         if ((mapping.direction & direction) == 0)
         {
             continue;
         }
         object value = MemberHelper.GetValue(mapping.memberInfo, target);
         if (mapping.repeats)
         {
             object[] values = (object[])value;
             if (values == null)
             {
                 continue;
             }
             for (int j = 0; j < values.Length; j++)
             {
                 if (values[j] != null)
                 {
                     headers.Add((SoapHeader)values[j]);
                 }
             }
         }
         else
         {
             if (value != null)
             {
                 headers.Add((SoapHeader)value);
             }
         }
     }
 }
Example #2
0
 public static void GetHeaderMembers(SoapHeaderCollection headers, object target, SoapHeaderMapping[] mappings, SoapHeaderDirection direction, bool client)
 {
     if ((mappings != null) && (mappings.Length != 0))
     {
         for (int i = 0; i < mappings.Length; i++)
         {
             SoapHeaderMapping mapping = mappings[i];
             if ((mapping.direction & direction) != 0)
             {
                 object obj2 = MemberHelper.GetValue(mapping.memberInfo, target);
                 if (mapping.repeats)
                 {
                     object[] objArray = (object[])obj2;
                     if (objArray != null)
                     {
                         for (int j = 0; j < objArray.Length; j++)
                         {
                             if (objArray[j] != null)
                             {
                                 headers.Add((SoapHeader)objArray[j]);
                             }
                         }
                     }
                 }
                 else if (obj2 != null)
                 {
                     headers.Add((SoapHeader)obj2);
                 }
             }
         }
     }
 }