Esempio n. 1
0
        /// <summary>
        /// Finds the parts.
        /// </summary>
        protected virtual void FindParts()
        {
            RegisterModules();

            ConfigurationManager.AddParts(GetExports <IConfigurationFactory>());
            Plugins = GetExports <IPlugin>();
        }
Esempio n. 2
0
        public void Init()
        {
            DiscoverTypes();

            ConfigurationManager.AddParts(GetExports <IConfigurationFactory>());

            // Have to migrate settings here as migration subsystem not yet initialised.
            MigrateNetworkConfiguration();
            NetManager = new NetworkManager(ConfigurationManager, LoggerFactory.CreateLogger <NetworkManager>());

            // Initialize runtime stat collection
            if (ConfigurationManager.Configuration.EnableMetrics)
            {
                DotNetRuntimeStatsBuilder.Default().StartCollecting();
            }

            var networkConfiguration = ConfigurationManager.GetNetworkConfiguration();

            HttpPort  = networkConfiguration.HttpServerPortNumber;
            HttpsPort = networkConfiguration.HttpsPortNumber;

            // Safeguard against invalid configuration
            if (HttpPort == HttpsPort)
            {
                HttpPort  = NetworkConfiguration.DefaultHttpPort;
                HttpsPort = NetworkConfiguration.DefaultHttpsPort;
            }

            CertificateInfo = new CertificateInfo
            {
                Path     = networkConfiguration.CertificatePath,
                Password = networkConfiguration.CertificatePassword
            };
            Certificate = GetCertificate(CertificateInfo);

            RegisterServices();

            _pluginManager.RegisterServices(ServiceCollection);
        }
Esempio n. 3
0
 /// <summary>
 /// Finds the parts.
 /// </summary>
 protected virtual void FindParts()
 {
     ConfigurationManager.AddParts(GetExports <IConfigurationFactory>());
     Plugins = GetExports <IPlugin>().Select(LoadPlugin).Where(i => i != null).ToArray();
 }
Esempio n. 4
0
 /// <summary>
 /// Finds the parts.
 /// </summary>
 protected void FindParts()
 {
     ConfigurationManager.AddParts(GetExports <IConfigurationFactory>());
     Plugins = new IPlugin[] { };
 }