本文整理汇总了C#中IConfigurationProvider类的典型用法代码示例。如果您正苦于以下问题:C# IConfigurationProvider类的具体用法?C# IConfigurationProvider怎么用?C# IConfigurationProvider使用的例子?那么恭喜您, 这里精选的类代码示例或许可以为您提供帮助。
IConfigurationProvider类属于命名空间,在下文中一共展示了IConfigurationProvider类的20个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于我们的系统推荐出更棒的C#代码示例。
示例1: DobermanConfiguration
public DobermanConfiguration(IConfigurationProvider configurationProvider)
: this()
{
CheckMongo(configurationProvider.GetMongoConnectionString());
CheckEmail(configurationProvider.GetSmtpMailSettings());
CheckSql(configurationProvider.GetSqlConnectionString());
}
开发者ID:moov2,项目名称:doberman,代码行数:7,代码来源:DobermanConfiguration.cs
示例2: Configuration
public Configuration(IConfigurationProvider configurationProvider)
{
if (configurationProvider == null)
throw new ArgumentNullException("configurationProvider");
_configurationProvider = configurationProvider;
}
开发者ID:Anupam-,项目名称:Ilaro.Admin,代码行数:7,代码来源:Configuration.cs
示例3: ShippingMethodAdminService
public ShippingMethodAdminService(IEnumerable<IShippingMethod> shippingMethods, UrlHelper urlHelper,
IConfigurationProvider configurationProvider)
{
_shippingMethods = shippingMethods;
_urlHelper = urlHelper;
_configurationProvider = configurationProvider;
}
开发者ID:neozhu,项目名称:Ecommerce,代码行数:7,代码来源:ShippingMethodAdminService.cs
示例4: IotHubTransportFactory
public IotHubTransportFactory(ISerialize serializer, ILogger logger,
IConfigurationProvider configurationProvider)
{
_serializer = serializer;
_logger = logger;
_configurationProvider = configurationProvider;
}
开发者ID:smartpcr,项目名称:azure-iot-remote-monitoring,代码行数:7,代码来源:IotHubTransportFactory.cs
示例5: IoTHubTransport
public IoTHubTransport(ISerialize serializer, ILogger logger, IConfigurationProvider configurationProvider, IDevice device)
{
_serializer = serializer;
_logger = logger;
_configurationProvider = configurationProvider;
_device = device;
}
开发者ID:b3540,项目名称:azure-iot-predictive-maintenance,代码行数:7,代码来源:IoTHubTransport.cs
示例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];
}
};
}
开发者ID:johnhk,项目名称:SyncTrayzor,代码行数:33,代码来源:ConflictResolutionViewModel.cs
示例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);
}
开发者ID:bnantz,项目名称:NCS-V1-1,代码行数:7,代码来源:StorageProviderFactory.cs
示例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);
开发者ID:RahmanM,项目名称:AutoMapper,代码行数:7,代码来源:EnumerableToDictionaryMapper.cs
示例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", "");
}
开发者ID:kinpro,项目名称:RapidTransit,代码行数:25,代码来源:RabbitMqConfigurationSettings.cs
示例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();
}
开发者ID:modulexcite,项目名称:SyncTrayzor,代码行数:25,代码来源:AboutViewModel.cs
示例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;
}
开发者ID:RagingRudolf,项目名称:CodeFirst.UCommerce,代码行数:7,代码来源:AssemblyByConfigurationBootstrap.cs
示例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");
}
开发者ID:smartpcr,项目名称:azure-iot-remote-monitoring,代码行数:7,代码来源:DocDbRestHelper.cs
示例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);
}
开发者ID:BernhardGlueck,项目名称:Wmc,代码行数:28,代码来源:Global.asax.cs
示例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;
}
开发者ID:chrisharrington,项目名称:showveoservice,代码行数:11,代码来源:TabletHandbrakeEncoder.cs
示例15: SendGridEmailer
public SendGridEmailer(IConfigurationProvider configuration)
{
if (configuration == null)
throw new ArgumentNullException("configuration");
_smtp = SMTP.GenerateInstance(new NetworkCredential(configuration.SendGridUserName, configuration.SendGridPassword));
}
开发者ID:chrisharrington,项目名称:LogWhatever,代码行数:7,代码来源:SendGridEmailer.cs
示例16: TableStorageEventListener
public TableStorageEventListener(IConfigurationProvider configurationProvider, IHealthReporter healthReporter)
: base(configurationProvider, healthReporter)
{
if (this.Disabled)
{
return;
}
Debug.Assert(configurationProvider != null);
this.CreateTableClient(configurationProvider);
Random randomNumberGenerator = new Random();
this.instanceId = randomNumberGenerator.Next(100000000).ToString("D8");
this.nextEntityId = 0;
this.identityIdResetLock = new object();
this.Sender = new ConcurrentEventSender<EventData>(
eventBufferSize: 1000,
maxConcurrency: MaxConcurrentPartitions,
batchSize: 50,
noEventsDelay: TimeSpan.FromMilliseconds(1000),
transmitterProc: this.SendEventsAsync,
healthReporter: healthReporter);
}
开发者ID:TylerAngell,项目名称:service-fabric-dotnet-management-party-cluster,代码行数:25,代码来源:TableStorageEventListener.cs
示例17: ConfigureAuth
public void ConfigureAuth(IAppBuilder app, IConfigurationProvider configProvider)
{
string aadClientId = configProvider.GetConfigurationSettingValue("ida.AADClientId");
string aadInstance = configProvider.GetConfigurationSettingValue("ida.AADInstance");
string aadTenant = configProvider.GetConfigurationSettingValue("ida.AADTenant");
string authority = string.Format(CultureInfo.InvariantCulture, aadInstance, aadTenant);
app.SetDefaultSignInAsAuthenticationType(CookieAuthenticationDefaults.AuthenticationType);
app.UseCookieAuthentication(new CookieAuthenticationOptions());
app.UseOpenIdConnectAuthentication(
new OpenIdConnectAuthenticationOptions
{
ClientId = aadClientId,
Authority = authority,
Notifications = new OpenIdConnectAuthenticationNotifications
{
AuthenticationFailed = context =>
{
string appBaseUrl = context.Request.Scheme + "://" + context.Request.Host + context.Request.PathBase;
context.ProtocolMessage.RedirectUri = appBaseUrl + "/";
context.HandleResponse();
context.Response.Redirect(context.ProtocolMessage.RedirectUri);
return Task.FromResult(0);
}
}
});
}
开发者ID:Azure,项目名称:azure-iot-remote-monitoring,代码行数:31,代码来源:Startup.Auth.cs
示例18: CreateTableClient
private void CreateTableClient(IConfigurationProvider configurationProvider)
{
string accountConnectionString = configurationProvider.GetValue("StorageAccountConnectionString");
string sasToken = configurationProvider.GetValue("StorageAccountSasToken");
if (string.IsNullOrWhiteSpace(sasToken) && string.IsNullOrWhiteSpace(accountConnectionString))
{
throw new ConfigurationErrorsException(
"Configuration must specify either the storage account connection string ('StorageAccountConnectionString' parameter) or SAS token ('StorageAccountSasToken' paramteter)");
}
string storageTableName = configurationProvider.GetValue("StorageTableName");
if (string.IsNullOrWhiteSpace(storageTableName))
{
throw new ConfigurationErrorsException("Configuration must specify the target storage name ('storageTableName' parameter)");
}
CloudStorageAccount storageAccount = string.IsNullOrWhiteSpace(sasToken)
? CloudStorageAccount.Parse(accountConnectionString)
: new CloudStorageAccount(new StorageCredentials(sasToken), useHttps: true);
this.cloudTable = storageAccount.CreateCloudTableClient().GetTableReference(storageTableName);
try
{
this.cloudTable.CreateIfNotExists();
}
catch (Exception e)
{
this.ReportListenerProblem("Could not ensure that destination Azure storage table exists" + Environment.NewLine + e.ToString());
throw;
}
}
开发者ID:TylerAngell,项目名称:service-fabric-dotnet-management-party-cluster,代码行数:32,代码来源:TableStorageEventListener.cs
示例19: CreateDevice
public IDevice CreateDevice(ILogger logger, ITransportFactory transportFactory,
ITelemetryFactory telemetryFactory, IConfigurationProvider configurationProvider, InitialDeviceConfig config)
{
var device = new DeviceBase(logger, transportFactory, telemetryFactory, configurationProvider);
device.Init(config);
return device;
}
开发者ID:smartpcr,项目名称:azure-iot-remote-monitoring,代码行数:7,代码来源:DeviceFactory.cs
示例20: TelemetryApiController
/// <summary>
/// Initializes a new instance of the TelemetryApiController class.
/// </summary>
/// <param name="deviceTelemetryLogic">
/// The IDeviceRegistryListLogic implementation that the new instance
/// will use.
/// </param>
/// <param name="alertsLogic">
/// The IAlertsLogic implementation that the new instance will use.
/// </param>
/// <param name="deviceLogic">
/// The IDeviceLogic implementation that the new instance will use.
/// </param>
public TelemetryApiController(
IDeviceTelemetryLogic deviceTelemetryLogic,
IAlertsLogic alertsLogic,
IDeviceLogic deviceLogic,
IConfigurationProvider configProvider)
{
if (deviceTelemetryLogic == null)
{
throw new ArgumentNullException("deviceTelemetryLogic");
}
if (alertsLogic == null)
{
throw new ArgumentNullException("alertsLogic");
}
if(deviceLogic == null)
{
throw new ArgumentNullException("deviceLogic");
}
if (configProvider == null)
{
throw new ArgumentNullException("configProvider");
}
_deviceTelemetryLogic = deviceTelemetryLogic;
_alertsLogic = alertsLogic;
_deviceLogic = deviceLogic;
_configProvider = configProvider;
}
开发者ID:selam99,项目名称:azure-iot-remote-monitoring,代码行数:44,代码来源:TelemetryApiController.cs
注:本文中的IConfigurationProvider类示例整理自Github/MSDocs等源码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。 |
请发表评论