当前位置: 首页>>代码示例>>C#>>正文


C# IConfigurationProvider类代码示例

本文整理汇总了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());
 }
开发者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


注:本文中的IConfigurationProvider类示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。