public IBootstrapper <TContainer> Populate(TBuilder builder, IPlatform platform) { Check.NotNull(builder, nameof(builder)); Check.NotNull(platform, nameof(platform)); var typeCatalog = platform.TypeCatalog; var frameworkConfig = new FrameworkConfiguration(typeCatalog); // We'll hang all configuration related stuff off this object. // Everything will be pre-configured with Nancy defaults. var applicationConfig = new ApplicationConfiguration <TBuilder>(builder, frameworkConfig); // This is the main configuration point for the user. // Here you can register stuff in the container, swap out // Nancy services, change configuration etc. this.ConfigureApplication(applicationConfig); // Get platform services to register in the container. var platformRegistry = platform.GetRegistry(); this.Register(builder, platformRegistry); // Once the user has configured everything, we build a // "container registry", this contains all registrations // for framework services. var frameworkRegistry = frameworkConfig.GetRegistry(); // We then call out to the bootstrapper implementation // to register all the registrations in the registry. this.Register(builder, frameworkRegistry); return(this); }
internal static FrameworkControl GetTuioTracking(FrameworkElement uiParent) { FrameworkControl tmpFrame = new TuioTracking(uiParent); FrameworkConfiguration conf = GetTuioConfig(uiParent); tmpFrame.ConfigureFramework(conf); return(tmpFrame); }
public override void ConfigureFramework(FrameworkConfiguration config) { if (!(config is TuioConfiguration)) throw new ArgumentException("Config must be TraalConfiguration"); this.config = config as TuioConfiguration; base.ConfigureFramework(config); }
internal Framework(FrameworkConfiguration configuration) { Configuration = configuration; var services = new ServiceCollection(); Startup.ConfigureServices(services, configuration, this); ServiceProvider = services.BuildServiceProvider(); }
public override void ConfigureFramework(FrameworkConfiguration config) { if (!(config is MouseConfiguration)) { throw new ArgumentException("Config must be MouseConfiguration"); } mouseConfig = config as MouseConfiguration; base.ConfigureFramework(config); }
public override void ConfigureFramework(FrameworkConfiguration config) { if (!(config is TuioConfiguration)) { throw new ArgumentException("Config must be TraalConfiguration"); } this.config = config as TuioConfiguration; base.ConfigureFramework(config); }
public override void ConfigureFramework(FrameworkConfiguration config) { if (!(config is TraalConfiguration)) { throw new ArgumentException("Config must be TraalConfiguration"); } traalConfig = config as TraalConfiguration; setTrackingConfig(trackingClient, traalConfig.TrackingConfigPath, traalConfig.UseVfwDriver); base.ConfigureFramework(config); }
public static void ConfigureServices(IServiceCollection services, FrameworkConfiguration configuration, Framework framework) { services.AddSingleton(configuration); services.AddSingleton(framework); services.AddLogging(configuration.LoggingConfiguration); services.AddSingleton(configuration.GuildConfigProvider); services.AddSingleton(configuration.DiscordClient); services.AddTransient <DiscordRestClient>(x => x.GetRequiredService <BaseSocketClient>().Rest); if (configuration.Communicator != null) { services.AddSingleton(configuration.Communicator); } else { services.AddSingleton <ICommunicator, Communicator>(); } services.AddSingleton <CommandRoutingService>(); services.AddSingleton <ICommandParser, CommandParser>(); services.AddSingleton <IUserFetcher, UserFetcher>(); services.AddScoped <IFrameworkReflector, FrameworkReflector>(); }
/// <summary> /// 静态构造 /// </summary> static BundleConfigProvider() { OSGi_NET_ALLTYPES_LOAD = false; OSGi_NET_IS_DEBUG_MODE = false; OSGi_NET_SINGLERUNNING = false; LoadFrameworkConfig(); if (FrameworkConfiguration.ContainsKey(OSGi_NET_ALL_TYPES_LOAD)) { OSGi_NET_ALLTYPES_LOAD = FrameworkConfiguration[OSGi_NET_ALL_TYPES_LOAD].Trim() == "1"; } if (FrameworkConfiguration.ContainsKey(OSGi_NET_DEBUG_MODE)) { OSGi_NET_IS_DEBUG_MODE = FrameworkConfiguration[OSGi_NET_DEBUG_MODE].Trim() == "1"; } if (FrameworkConfiguration.ContainsKey(OSGi_NET_SINGLE_RUNNING)) { OSGi_NET_SINGLERUNNING = FrameworkConfiguration[OSGi_NET_SINGLE_RUNNING].Trim() == "1"; } }
public CommandRoutingService( FrameworkConfiguration config, BaseSocketClient client, ICommunicator communicator, IFrameworkGuildConfigProvider guildConfigProvider, ICommandParser commandParser, ILogger <CommandRoutingService> logger, ILoggerFactory loggerFactory) { _client = client; _clientServiceProvider = config.ClientServiceProvider; _communicator = communicator; _defaultCommandPrefix = config.DefaultCommandPrefix; _ownerIDs = config.OwnerIDs; _guildConfigProvider = guildConfigProvider; _commandParser = commandParser; _logger = logger; _loggerFactory = loggerFactory; foreach (var module in config.Modules) { AddModule(module); } }
public FrameworkReflector(FrameworkConfiguration configuration) { _configuration = configuration ?? throw new ArgumentNullException(nameof(configuration)); }