private static ActionHeader GetActionHeader(AddressingVersion addressingVersion, ReliableMessagingVersion reliableMessagingVersion, string element)
        {
            WsrmIndex index = null;

            if (reliableMessagingVersion == ReliableMessagingVersion.WSReliableMessagingFebruary2005)
            {
                if (addressingVersion == AddressingVersion.WSAddressingAugust2004)
                {
                    if (wsAddressingAug2004WSReliableMessagingFeb2005 == null)
                    {
                        wsAddressingAug2004WSReliableMessagingFeb2005 = new WsrmFeb2005Index(addressingVersion);
                    }
                    index = wsAddressingAug2004WSReliableMessagingFeb2005;
                }
                else if (addressingVersion == AddressingVersion.WSAddressing10)
                {
                    if (wsAddressing10WSReliableMessagingFeb2005 == null)
                    {
                        wsAddressing10WSReliableMessagingFeb2005 = new WsrmFeb2005Index(addressingVersion);
                    }
                    index = wsAddressing10WSReliableMessagingFeb2005;
                }
            }
            else
            {
                if (reliableMessagingVersion != ReliableMessagingVersion.WSReliableMessaging11)
                {
                    throw Fx.AssertAndThrow("Reliable messaging version not supported.");
                }
                if (addressingVersion == AddressingVersion.WSAddressingAugust2004)
                {
                    if (wsAddressingAug2004WSReliableMessaging11 == null)
                    {
                        wsAddressingAug2004WSReliableMessaging11 = new Wsrm11Index(addressingVersion);
                    }
                    index = wsAddressingAug2004WSReliableMessaging11;
                }
                else if (addressingVersion == AddressingVersion.WSAddressing10)
                {
                    if (wsAddressing10WSReliableMessaging11 == null)
                    {
                        wsAddressing10WSReliableMessaging11 = new Wsrm11Index(addressingVersion);
                    }
                    index = wsAddressing10WSReliableMessaging11;
                }
            }
            if (index == null)
            {
                throw DiagnosticUtility.ExceptionUtility.ThrowHelperError(new ProtocolException(System.ServiceModel.SR.GetString("AddressingVersionNotSupported", new object[] { addressingVersion })));
            }
            return(index.GetActionHeader(element));
        }
 private static ActionHeader GetActionHeader(AddressingVersion addressingVersion, ReliableMessagingVersion reliableMessagingVersion, string element)
 {
     WsrmIndex index = null;
     if (reliableMessagingVersion == ReliableMessagingVersion.WSReliableMessagingFebruary2005)
     {
         if (addressingVersion == AddressingVersion.WSAddressingAugust2004)
         {
             if (wsAddressingAug2004WSReliableMessagingFeb2005 == null)
             {
                 wsAddressingAug2004WSReliableMessagingFeb2005 = new WsrmFeb2005Index(addressingVersion);
             }
             index = wsAddressingAug2004WSReliableMessagingFeb2005;
         }
         else if (addressingVersion == AddressingVersion.WSAddressing10)
         {
             if (wsAddressing10WSReliableMessagingFeb2005 == null)
             {
                 wsAddressing10WSReliableMessagingFeb2005 = new WsrmFeb2005Index(addressingVersion);
             }
             index = wsAddressing10WSReliableMessagingFeb2005;
         }
     }
     else
     {
         if (reliableMessagingVersion != ReliableMessagingVersion.WSReliableMessaging11)
         {
             throw Fx.AssertAndThrow("Reliable messaging version not supported.");
         }
         if (addressingVersion == AddressingVersion.WSAddressingAugust2004)
         {
             if (wsAddressingAug2004WSReliableMessaging11 == null)
             {
                 wsAddressingAug2004WSReliableMessaging11 = new Wsrm11Index(addressingVersion);
             }
             index = wsAddressingAug2004WSReliableMessaging11;
         }
         else if (addressingVersion == AddressingVersion.WSAddressing10)
         {
             if (wsAddressing10WSReliableMessaging11 == null)
             {
                 wsAddressing10WSReliableMessaging11 = new Wsrm11Index(addressingVersion);
             }
             index = wsAddressing10WSReliableMessaging11;
         }
     }
     if (index == null)
     {
         throw DiagnosticUtility.ExceptionUtility.ThrowHelperError(new ProtocolException(System.ServiceModel.SR.GetString("AddressingVersionNotSupported", new object[] { addressingVersion })));
     }
     return index.GetActionHeader(element);
 }