Ejemplo n.º 1
0
        /// -----------------------------------------------------------------------------
        /// <summary>
        /// Chargement des données de configuration
        /// </summary>
        /// <param name="args">Arguments de la ligne de commande</param>
        /// -----------------------------------------------------------------------------
        public override void LoadConfiguration(string[] args)
        {
            Args = args;

            GlobalLogger = CreateLoggers();
            Log(Shared.Resources.Strings.LOADING_CONFIGURATION, ESeverity.DEBUG);
            var cfg = new SharedConfig(Configuration);
            // unneeded in IIs web hosting model, see web.config
            // m_protocol = GenericProtocol.GetInstance(cfg);
            SetCulture(cfg.ServiceCulture);
        }
Ejemplo n.º 2
0
 /// -----------------------------------------------------------------------------
 /// <summary>
 /// Constructeur
 /// </summary>
 /// <param name="context">le contexte du test</param>
 /// <param name="config">la configuration serveur</param>
 /// -----------------------------------------------------------------------------
 public TestServer(TestContext context, ConfigPackage config)
 {
     _context = context;
     _servercfg = new SharedConfig(config);
     Configuration = config;
 }
Ejemplo n.º 3
0
        /// -----------------------------------------------------------------------------
        /// <summary>
        /// Chargement des données de configuration
        /// </summary>
        /// <param name="args">Arguments de la ligne de commande</param>
        /// -----------------------------------------------------------------------------
        public virtual void LoadConfiguration(string[] args)
        {
            Args = args;

            GlobalLogger = CreateLoggers();
            Log(Strings.LOADING_CONFIGURATION, ESeverity.DEBUG);
            var cfg = new SharedConfig(Configuration);
            Protocol = GenericProtocol.GetInstance(cfg);
            SetCulture(cfg.ServiceCulture);
        }
Ejemplo n.º 4
0
        /// -----------------------------------------------------------------------------
        /// <summary>
        /// Obtient un protocole adapté d'après la configuration
        /// </summary>
        /// <param name="config">la configuration contenant le type du protocole</param>
        /// <returns>une instance adaptée</returns>
        /// -----------------------------------------------------------------------------
        public static GenericProtocol GetInstance(SharedConfig config)
        {
            var protoObj = ((GenericProtocol)typeof(GenericProtocol).Assembly.CreateInstance(config.ServiceProtocol));
            if (protoObj == null)
                throw new NotSupportedException(config.ServiceProtocol);

			protoObj.Name = config.ServiceName;
            protoObj.Port = config.ServicePort;
            protoObj.Address = config.ServiceAddress;
            return protoObj;
        }