本文整理汇总了C#中IConfigurationProvider类的典型用法代码示例。如果您正苦于以下问题:C# IConfigurationProvider类的具体用法?C# IConfigurationProvider怎么用?C# IConfigurationProvider使用的例子?那么恭喜您, 这里精选的类代码示例或许可以为您提供帮助。
IConfigurationProvider类属于命名空间,在下文中一共展示了IConfigurationProvider类的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C#代码示例。
示例1: DobermanConfiguration
public DobermanConfiguration(IConfigurationProvider configurationProvider)
: this()
{
CheckMongo(configurationProvider.GetMongoConnectionString());
CheckEmail(configurationProvider.GetSmtpMailSettings());
CheckSql(configurationProvider.GetSqlConnectionString());
}
示例2: Configuration
public Configuration(IConfigurationProvider configurationProvider)
{
if (configurationProvider == null)
throw new ArgumentNullException("configurationProvider");
_configurationProvider = configurationProvider;
}
示例3: ShippingMethodAdminService
public ShippingMethodAdminService(IEnumerable<IShippingMethod> shippingMethods, UrlHelper urlHelper,
IConfigurationProvider configurationProvider)
{
_shippingMethods = shippingMethods;
_urlHelper = urlHelper;
_configurationProvider = configurationProvider;
}
示例4: IotHubTransportFactory
public IotHubTransportFactory(ISerialize serializer, ILogger logger,
IConfigurationProvider configurationProvider)
{
_serializer = serializer;
_logger = logger;
_configurationProvider = configurationProvider;
}
示例5: IoTHubTransport
public IoTHubTransport(ISerialize serializer, ILogger logger, IConfigurationProvider configurationProvider, IDevice device)
{
_serializer = serializer;
_logger = logger;
_configurationProvider = configurationProvider;
_device = device;
}
示例6: ConflictResolutionViewModel
public ConflictResolutionViewModel(
ISyncthingManager syncthingManager,
IConflictFileManager conflictFileManager,
IProcessStartProvider processStartProvider,
IConflictFileWatcher conflictFileWatcher,
IWindowManager windowManager,
IConfigurationProvider configurationProvider)
{
this.syncthingManager = syncthingManager;
this.conflictFileManager = conflictFileManager;
this.processStartProvider = processStartProvider;
this.conflictFileWatcher = conflictFileWatcher;
this.configurationProvider = configurationProvider;
this.windowManager = windowManager;
this.DeleteToRecycleBin = this.configurationProvider.Load().ConflictResolverDeletesToRecycleBin;
this.Bind(s => s.DeleteToRecycleBin, (o, e) => this.configurationProvider.AtomicLoadAndSave(c => c.ConflictResolverDeletesToRecycleBin = e.NewValue));
this.Conflicts.CollectionChanged += (o, e) =>
{
if ((e.Action == NotifyCollectionChangedAction.Add && (e.OldItems?.Count ?? 0) == 0) ||
(e.Action == NotifyCollectionChangedAction.Remove && (e.NewItems?.Count ?? 0) == 0) ||
(e.Action == NotifyCollectionChangedAction.Reset))
{
this.NotifyOfPropertyChange(nameof(this.Conflicts));
this.NotifyOfPropertyChange(nameof(this.IsLoadingAndNoConflictsFound));
this.NotifyOfPropertyChange(nameof(this.HasFinishedLoadingAndNoConflictsFound));
if (this.SelectedConflict == null && this.Conflicts.Count > 0)
this.SelectedConflict = this.Conflicts[0];
}
};
}
示例7: InitializeConfigurationProvider
protected override void InitializeConfigurationProvider(string sectionName, IConfigurationProvider provider)
{
StorageProviderData storageProviderData = GetStorageProviderData(sectionName);
provider.ConfigurationName = storageProviderData.Name;
((IStorageProviderReader)provider).CurrentSectionName = sectionName;
base.InitializeConfigurationProvider (sectionName, provider);
}
示例8: MapExpression
public Expression MapExpression(TypeMapRegistry typeMapRegistry, IConfigurationProvider configurationProvider,
PropertyMap propertyMap, Expression sourceExpression, Expression destExpression,
Expression contextExpression)
=>
typeMapRegistry.MapCollectionExpression(configurationProvider, propertyMap, sourceExpression, destExpression,
contextExpression, CollectionMapperExtensions.IfNotNull, typeof(Dictionary<,>),
CollectionMapperExtensions.MapItemExpr);
示例9: RabbitMqConfigurationSettings
public RabbitMqConfigurationSettings(IConfigurationProvider configurationProvider)
{
string host;
if (false == configurationProvider.TryGetSetting("RabbitMQHost", out host))
throw new ConfigurationErrorsException("The RabbitMQHost was not configured");
string username;
if (false == configurationProvider.TryGetSetting("RabbitMQUsername", out username))
throw new ConfigurationErrorsException("The RabbitMQUsername was not configured");
string password;
if (false == configurationProvider.TryGetSetting("RabbitMQPassword", out password))
throw new ConfigurationErrorsException("The RabbitMQPassword was not configured");
Host = host;
Username = username;
Password = password;
Heartbeat = (ushort)configurationProvider.GetSetting("RabbitMQHeartbeat", 30);
Port = configurationProvider.GetSetting("RabbitMQPort", 5672);
VirtualHost = configurationProvider.GetSetting("RabbitMQVirtualHost", "");
Options = configurationProvider.GetSetting("RabbitMQOptions", "");
HighAvailabilityQueuePrefix = configurationProvider.GetSetting("RabbitMQHAPrefix", "");
}
示例10: AboutViewModel
public AboutViewModel(
IWindowManager windowManager,
ISyncThingManager syncThingManager,
IConfigurationProvider configurationProvider,
IUpdateManager updateManager,
Func<ThirdPartyComponentsViewModel> thirdPartyComponentsViewModelFactory,
IProcessStartProvider processStartProvider)
{
this.windowManager = windowManager;
this.syncThingManager = syncThingManager;
this.updateManager = updateManager;
this.thirdPartyComponentsViewModelFactory = thirdPartyComponentsViewModelFactory;
this.processStartProvider = processStartProvider;
this.Version = Assembly.GetExecutingAssembly().GetName().Version.ToString(3);
this.HomepageUrl = Properties.Settings.Default.HomepageUrl;
this.SyncthingVersion = this.syncThingManager.Version == null ? Resources.AboutView_UnknownVersion : this.syncThingManager.Version.Version;
this.syncThingManager.DataLoaded += (o, e) =>
{
this.SyncthingVersion = this.syncThingManager.Version == null ? Resources.AboutView_UnknownVersion : this.syncThingManager.Version.Version;
};
this.CheckForNewerVersionAsync();
}
示例11: AssemblyByConfigurationBootstrap
public AssemblyByConfigurationBootstrap(IConfigurationProvider configurationProvider, ISessionProvider sessionProvider)
{
if (configurationProvider == null) throw new ArgumentNullException(nameof(configurationProvider));
if (sessionProvider == null) throw new ArgumentNullException(nameof(sessionProvider));
_configurationProvider = configurationProvider;
_sessionProvider = sessionProvider;
}
示例12: DocDbRestHelper
public DocDbRestHelper(IConfigurationProvider configProvider)
{
this._docDbEndpoint = configProvider.GetConfigurationSettingValue("docdb.EndpointUrl");
this._docDbKey = configProvider.GetConfigurationSettingValue("docdb.PrimaryAuthorizationKey");
this._dbName = configProvider.GetConfigurationSettingValue("docdb.DatabaseId");
this._collectionName = configProvider.GetConfigurationSettingValue("docdb.DocumentCollectionId");
}
示例13: CreateContainer
private void CreateContainer(HttpConfiguration configuration,IApplicationHost applicationHost,IConfigurationProvider configurationProvider)
{
var assemblies = applicationHost.Assemblies.ToArray();
var containerBuilder = new ContainerBuilder();
containerBuilder.RegisterModelBinderProvider();
//containerBuilder.RegisterFilterProvider(); TODO: Seems to be an autofac MVC4 integration issue
containerBuilder.RegisterModelBinders(assemblies);
containerBuilder.RegisterApiControllers(assemblies);
containerBuilder.RegisterControllers(assemblies);
containerBuilder.RegisterWebApiFilterProvider(configuration);
containerBuilder.RegisterWebApiModelBinders(assemblies);
containerBuilder.RegisterModule(new AutofacWebTypesModule());
containerBuilder.RegisterAssemblyModules(assemblies);
containerBuilder.RegisterAssemblyTypes(assemblies).Where(t => t.IsAssignableTo<IRouteProvider>()).As<IRouteProvider>();
containerBuilder.RegisterAssemblyTypes(assemblies).Where(t => t.IsAssignableTo<IBootTask>()).As<IBootTask>();
containerBuilder.RegisterAssemblyTypes(assemblies).Where(t => t.IsAssignableTo<AreaRegistration>()).As<AreaRegistration>();
containerBuilder.RegisterInstance(applicationHost).As<IApplicationHost>();
containerBuilder.RegisterInstance(configurationProvider).As<IConfigurationProvider>();
var container = containerBuilder.Build();
DependencyResolver.SetResolver(new AutofacDependencyResolver(container));
configuration.DependencyResolver = new AutofacWebApiDependencyResolver(container);
SignalR.GlobalHost.DependencyResolver = new AutofacSignalRDependencyResolver(container);
}
示例14: TabletHandbrakeEncoder
/// <summary>
/// The default constructor.
/// </summary>
/// <param name="configuration">The application configuration.</param>
public TabletHandbrakeEncoder(IConfigurationProvider configuration)
{
if (configuration == null)
throw new ArgumentNullException("configuration");
_tabletHandbrakeCommand = configuration.TabletHandbrakeCommand;
}
示例15: SendGridEmailer
public SendGridEmailer(IConfigurationProvider configuration)
{
if (configuration == null)
throw new ArgumentNullException("configuration");
_smtp = SMTP.GenerateInstance(new NetworkCredential(configuration.SendGridUserName, configuration.SendGridPassword));
}