Source/NFX.Web/Pay/PaySystem.cs
/// <summary>
/// Automatically starts systems designated in config with auto-start attribute
/// </summary>
Automatically starts systems designated in config with auto-start attribute
Automatically starts systems designated in config with auto - start attribute
public static void AutoStartSystems()
      {
        App.Instance.RegisterAppFinishNotifiable(PayProcessingFinisher.Instance);
        WebSettings.RequireInitializedSettings();
        var pHost = App.ConfigRoot[WebSettings.CONFIG_WEBSETTINGS_SECTION][CONFIG_PAYMENT_PROCESSING_SECTION][CONFIG_PAY_SYSTEM_HOST_SECTION];
        if (pHost.Exists)
        {
          var host = FactoryUtils.MakeAndConfigure<PaySystemHost>(pHost, typeof(PaySystemHost), new object[] { null, pHost });
          host.Start();
          ___SetPaySystemHost(host);
        }
        foreach (var psNode in App.ConfigRoot[WebSettings.CONFIG_WEBSETTINGS_SECTION][CONFIG_PAYMENT_PROCESSING_SECTION]
                                  .Children
                                  .Where(cn => cn.IsSameName(CONFIG_PAY_SYSTEM_SECTION)))
        {
          var name = psNode.AttrByName(Configuration.CONFIG_NAME_ATTR).Value;
          if (!psNode.AttrByName(CONFIG_AUTO_START_ATTR).ValueAsBool()) continue;
          var system = FactoryUtils.MakeAndConfigure<PaySystem>(psNode, typeof(PaySystem), new object[] { null, psNode });
          if (s_Instances[system.Name] != null) 
            throw new PaymentException("AutoStart: " + StringConsts.PAYMENT_SYSTEM_DUPLICATE_NAME_ERROR.Args(system.GetType().FullName, system.Name));
          system.Start();
        }
      }
public static void AutoStartSystems ( ) { App . Instance . RegisterAppFinishNotifiable ( PayProcessingFinisher . Instance ) ; WebSettings . RequireInitializedSettings ( ) ; var pHost = App . ConfigRoot [ WebSettings . CONFIG_WEBSETTINGS_SECTION ] [ CONFIG_PAYMENT_PROCESSING_SECTION ] [ CONFIG_PAY_SYSTEM_HOST_SECTION ] ; if ( pHost . Exists ) { var host = FactoryUtils . MakeAndConfigure < PaySystemHost > ( pHost , typeof ( PaySystemHost ) , new object [ ] { null , pHost } ) ; host . Start ( ) ; ___SetPaySystemHost ( host ) ; } foreach ( var psNode in App . ConfigRoot [ WebSettings . CONFIG_WEBSETTINGS_SECTION ] [ CONFIG_PAYMENT_PROCESSING_SECTION ] . Children . Where ( cn => cn . IsSameName ( CONFIG_PAY_SYSTEM_SECTION ) ) ) { var name = psNode . AttrByName ( Configuration . CONFIG_NAME_ATTR ) . Value ; if ( ! psNode . AttrByName ( CONFIG_AUTO_START_ATTR ) . ValueAsBool ( ) ) continue ; var system = FactoryUtils . MakeAndConfigure < PaySystem > ( psNode , typeof ( PaySystem ) , new object [ ] { null , psNode } ) ; if ( s_Instances [ system . Name ] != null ) throw new PaymentException ( " " + StringConsts . PAYMENT_SYSTEM_DUPLICATE_NAME_ERROR . Args ( system . GetType ( ) . FullName , system . Name ) ) ; system . Start ( ) ; } }
Automatically starts systems designated in config with auto-start attribute
Automatically starts systems designated in config with auto - start attribute
// already started