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


C# ISettingsProvider类代码示例

本文整理汇总了C#中ISettingsProvider的典型用法代码示例。如果您正苦于以下问题:C# ISettingsProvider类的具体用法?C# ISettingsProvider怎么用?C# ISettingsProvider使用的例子?那么恭喜您, 这里精选的类代码示例或许可以为您提供帮助。


ISettingsProvider类属于命名空间,在下文中一共展示了ISettingsProvider类的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C#代码示例。

示例1: RouteQueryModule

        public RouteQueryModule(ISettingsProvider settingsProvider)
            : base("/query")
        {
            _settingsProvider = settingsProvider;
            this.EnableCors();

            Get["/stations"] =
                parameters =>
                    {
                        IEnumerable<IStation> stations = GetStations();
                        return stations != null
                                   ? Response.AsJson(stations).WithContentType(@"application/json; charset=utf-8")
                                   : new Response().WithStatusCode(HttpStatusCode.InternalServerError);
                    };
            Get["/station/{StationId}"] =
                parameters =>
                    {
                        IEnumerable<IRoute> stationRoutes = GetStationRoutes(parameters.StationId);
                        return stationRoutes != null
                                   ? Response.AsJson(stationRoutes)
                                   : new Response().WithStatusCode(HttpStatusCode.InternalServerError);
                    };
            Get["/date/{Date}/route/{TrainNo}/from/{FromId}/to/{ToId}"] =
                parameters =>
                    {
                        DateTime date = DateTime.ParseExact(parameters.Date, "yyyyMMdd", CultureInfo.InvariantCulture);
                        IEnumerable<ITrainRoute> trainRoutes = GetTrainRoutes(date, parameters.TrainNo, parameters.FromId, parameters.ToId);
                        return trainRoutes != null
                                   ? Response.AsJson(trainRoutes)
                                   : new Response().WithStatusCode(HttpStatusCode.InternalServerError);
                    };
        }
开发者ID:jouni-kantola,项目名称:NarGarNastaTagAPI,代码行数:32,代码来源:RouteQueryModule.cs

示例2: ProjectSyncConfiguration

 public ProjectSyncConfiguration(ISettingsProvider provider)
 {
     var ignored = provider.GetSettings("IgnoreDirectories");
     IgnoredDirectories = string.IsNullOrEmpty(ignored)
         ? new string[] {}
         : ignored.Split(',').Select(x => x.Trim()).ToArray();
 }
开发者ID:stormleoxia,项目名称:lx,代码行数:7,代码来源:ProjectSyncConfiguration.cs

示例3: AssemblyBusServiceConfigurator

 public AssemblyBusServiceConfigurator(IEnumerable<IEndpointSpecification> endpointSpecifications, IServiceSpecification serviceSpecification,
     ISettingsProvider settingsProvider)
 {
     _serviceSpecification = serviceSpecification;
     _settingsProvider = settingsProvider;
     _endpointSpecifications = endpointSpecifications.ToArray();
 }
开发者ID:kotvisbj,项目名称:MassTransit,代码行数:7,代码来源:AssemblyBusServiceConfigurator.cs

示例4: TestableSolutionPackageRepository

		public TestableSolutionPackageRepository (
			ISolution solution,
			IMonoDevelopPackageRepositoryFactory repositoryFactory,
			ISettingsProvider settingsProvider)
			: base (solution, repositoryFactory, settingsProvider)
		{
		}
开发者ID:FreeBSD-DotNet,项目名称:monodevelop,代码行数:7,代码来源:TestableSolutionPackageRepository.cs

示例5: DeploymentSettingsPrioritiesTests

        public DeploymentSettingsPrioritiesTests()
        {
            var settingsPriority1 = new Dictionary<string, string>();
            settingsPriority1["key1"] = "settingsPriority1_value1";
            settingsPriority1["key2"] = "settingsPriority1_value2";
            settingsPriority1["key3"] = "settingsPriority1_value3";
            settingsPriority1["key4"] = "settingsPriority1_value4";

            var settingsPriority2 = new Dictionary<string, string>();
            settingsPriority1["key2"] = "settingsPriority2_value2";
            settingsPriority1["key3"] = "settingsPriority2_value3";
            settingsPriority1["key5"] = "settingsPriority2_value5";
            settingsPriority1["key6"] = "settingsPriority2_value6";

            var settingsPriority50 = new Dictionary<string, string>();
            settingsPriority1["key1"] = "settingsPriority50_value1";
            settingsPriority1["key2"] = "settingsPriority50_value2";
            settingsPriority1["key5"] = "settingsPriority50_value5";
            settingsPriority1["key7"] = "settingsPriority50_value7";

            var testProvider1 = new BasicSettingsProvider(settingsPriority1, (SettingsProvidersPriority)1);
            var testProvider2 = new BasicSettingsProvider(settingsPriority2, (SettingsProvidersPriority)2);
            var testProvider50 = new BasicSettingsProvider(settingsPriority50, (SettingsProvidersPriority)50);
            var settingsProviders = new ISettingsProvider[] { testProvider1, testProvider50, testProvider2 };

            PerSiteSettingsProvider perSiteSettings = null;
            deploymentSettingsManager = new DeploymentSettingsManager(perSiteSettings, settingsProviders);
        }
开发者ID:40a,项目名称:kudu,代码行数:28,代码来源:DeploymentSettingsPrioritiesTests.cs

示例6: InstallController

 // ReSharper restore UnusedAutoPropertyAccessor.Global
 //public InstallController(Func<IProviderInfo<IDatabaseProvider>> databaseProvidersInfo)
 public InstallController(IDatabaseProvider databaseProvider, Func<IProviderInfo<IDatabaseProvider>> databaseProvidersInfo, ISettingsProvider settingsProvider, IFederatedAuthenticationService federatedAuthenticationService)
 {
     this.databaseProvider = databaseProvider;
     this.databaseProvidersInfo = databaseProvidersInfo;
     this.settingsProvider = settingsProvider;
     this.federatedAuthenticationService = federatedAuthenticationService;
 }
开发者ID:noopman,项目名称:FunnelWeb,代码行数:9,代码来源:InstallController.cs

示例7: TestIndicesUtilCustomization

 public TestIndicesUtilCustomization(
     IRequestConfiguration requestConfig,
     ISettingsProvider settings = null)
 {
     this.settings = settings;
     this.requestConfig = requestConfig;
 }
开发者ID:freemsly,项目名称:Sitecore-ElasticAnalytics,代码行数:7,代码来源:TestIndicesUtilCustomization.cs

示例8: SubActivityDao

 public SubActivityDao(ISession session, 
     ISettingsProvider<SubSettings> subSettings,
     ICache cache)
     : base(session, subSettings)
 {
     _cache = cache;
 }
开发者ID:skimur,项目名称:skimur,代码行数:7,代码来源:SubActivityDao.cs

示例9: TagConverter

        public TagConverter(ISettingsProvider settingsProvider)
        {
            using (var reader = new StreamReader(settingsProvider.Get<string>(SettingsKeys.TagMappingFile)))
            {
                normalizedTags = reader
                    .ReadAllLines()
                    .Where(x => !string.IsNullOrWhiteSpace(x))
                    .Select(ParseTagDescription)
                    .ToDictionary(x => x.Name, x => x.RawTags);

                rawTagsMapping = normalizedTags
                    .SelectMany(normalizedTag => normalizedTag.Value.Select(rawTag => new { Normalized = normalizedTag.Key, Raw = rawTag }))
                    .ToDictionary(x => x.Raw, x => x.Normalized);
            }

            using (var reader = new StreamReader(settingsProvider.Get<string>(SettingsKeys.CorrectionsFile)))
            {
                correctionsByProblemUrl = reader
                    .ReadAllLines()
                    .Where(x => !string.IsNullOrWhiteSpace(x))
                    .SelectMany(ParseCorrections)
                    .GroupBy(x => x.ProblemUrl)
                    .ToDictionary(x => x.Key, x => x.ToArray());
            }
        }
开发者ID:BurlakovNick,项目名称:AcmProblemClassifier,代码行数:25,代码来源:TagConverter.cs

示例10: Context

        protected override void Context()
        {
            _sendEmailRequest = new SendMailRequest
                                    {
                                        To = "[email protected]",
                                        Subject = "important message for you bob",
                                        Message = "hi bob, this is not really that important. Just wanted to say hello."
                                    };

            _smtpClient = MockRepository.GenerateStub<ISmtpWrapper>();

            _smtpClient.Stub(x => x.Send(Arg<MailMessage>.Is.Anything))
                .WhenCalled(x => _mailMessagePassedToSmtpWrapper = x.Arguments[0] as MailMessage);

            _settingsProvider = MockRepository.GenerateStub<ISettingsProvider>();
            _settingsProvider.Stub(x => x.GetEmailSettings())
                .Return(new EmailSettings{AdminEmailAddress = AdminEmailAddress});

            _expectedMailMessage = new MailMessage();
            _expectedMailMessage.To.Add(_sendEmailRequest.To);
            _expectedMailMessage.From = new MailAddress(AdminEmailAddress);
            _expectedMailMessage.Subject = _sendEmailRequest.Subject;
            _expectedMailMessage.Body = _sendEmailRequest.Message;
            _expectedMailMessage.IsBodyHtml = true;

            _emailService = new EmailService(_smtpClient, _settingsProvider);
        }
开发者ID:AcklenAvenue,项目名称:PRTools,代码行数:27,代码来源:when_sending_an_email.cs

示例11: BrowserStarter

        public BrowserStarter(ISettingsProvider settingsProvider)
        {
            var settings = settingsProvider.Load();

            this.ExecutablePath = settings.BrowserExecutablePath;
            this.ExecutableArguments = settings.BrowserExecutableArguments;
        }
开发者ID:Anyante,项目名称:syndication-tool,代码行数:7,代码来源:BrowserStarter.cs

示例12: SettingsViewModel

        public SettingsViewModel(
            IScreen screen,
            ISettingsProvider settingsProvider,
            IFolderHelper folderHelper, 
            IAppContext appContext)
        {
            HostScreen = screen;

            BackCommand = new ReactiveAsyncCommand();
            BackCommand.RegisterAsyncAction(_ => HostScreen.Router.NavigateBack.Execute(null));

            SelectFolder = new ReactiveAsyncCommand();
            SelectFolder.RegisterAsyncAction(_ =>
            {
                var result = folderHelper.SelectFolder();
                if (result.Result == true) {
                    UpdateLocation = result.Folder;
                }
            }, appContext.DispatcherScheduler);

            UpdateLocation = settingsProvider.UpdateLocation;

            _IsError = this.WhenAny(vm => vm.UpdateLocation, vm => vm.Value)
                           .DistinctUntilChanged()
                           .Throttle(TimeSpan.FromMilliseconds(500))
                           .ObserveOn(appContext.DispatcherScheduler)
                           .Select(text => !IsUrlOrFolder(text))
                           .Do(error => {
                                if (!error) {
                                    settingsProvider.UpdateLocation = UpdateLocation;
                                }
                            })
                            .ToProperty(this, vm => vm.IsError, setViaReflection: false);
        }
开发者ID:rzhw,项目名称:Squirrel.Samples,代码行数:34,代码来源:SettingsViewModel.cs

示例13: SolutionPackageRepositoryPath

		public SolutionPackageRepositoryPath (
			ISolution solution,
			ISettingsProvider settingsProvider)
		{
			this.solution = solution;
			PackageRepositoryPath = GetSolutionPackageRepositoryPath (settingsProvider);
		}
开发者ID:FreeBSD-DotNet,项目名称:monodevelop,代码行数:7,代码来源:SolutionPackageRepositoryPath.cs

示例14: EventLogFilterRepo

 public EventLogFilterRepo(ISettingsProvider settingsProvider, IEventRecordTimeSpanSearcher eventRecordTimeSpanSearcher, ICacheLayer sweetCacheLayer)
 {
     EventLogCache = sweetCacheLayer;
     ListOfServersToQuery = settingsProvider.ServersToQuery;
     SearchTermsList = settingsProvider.FilterTerm;
     EventRTimeSearcher = eventRecordTimeSpanSearcher;
 }
开发者ID:patriklindstrom,项目名称:LBQ,代码行数:7,代码来源:EventLogFilterRepo.cs

示例15: TagsController

        public TagsController(ITagRepository tagRepository, ISettingsProvider settingsProvider)
        {
            _tagRepository = tagRepository;
            _settingsProvider = settingsProvider;

            PageSize = _settingsProvider.GetSettings().PageSize;
        }
开发者ID:OrenTiger,项目名称:my-personal-blog,代码行数:7,代码来源:TagsController.cs


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