本文整理汇总了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);
};
}
示例2: ProjectSyncConfiguration
public ProjectSyncConfiguration(ISettingsProvider provider)
{
var ignored = provider.GetSettings("IgnoreDirectories");
IgnoredDirectories = string.IsNullOrEmpty(ignored)
? new string[] {}
: ignored.Split(',').Select(x => x.Trim()).ToArray();
}
示例3: AssemblyBusServiceConfigurator
public AssemblyBusServiceConfigurator(IEnumerable<IEndpointSpecification> endpointSpecifications, IServiceSpecification serviceSpecification,
ISettingsProvider settingsProvider)
{
_serviceSpecification = serviceSpecification;
_settingsProvider = settingsProvider;
_endpointSpecifications = endpointSpecifications.ToArray();
}
示例4: TestableSolutionPackageRepository
public TestableSolutionPackageRepository (
ISolution solution,
IMonoDevelopPackageRepositoryFactory repositoryFactory,
ISettingsProvider settingsProvider)
: base (solution, repositoryFactory, settingsProvider)
{
}
示例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);
}
示例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;
}
示例7: TestIndicesUtilCustomization
public TestIndicesUtilCustomization(
IRequestConfiguration requestConfig,
ISettingsProvider settings = null)
{
this.settings = settings;
this.requestConfig = requestConfig;
}
示例8: SubActivityDao
public SubActivityDao(ISession session,
ISettingsProvider<SubSettings> subSettings,
ICache cache)
: base(session, subSettings)
{
_cache = cache;
}
示例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());
}
}
示例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);
}
示例11: BrowserStarter
public BrowserStarter(ISettingsProvider settingsProvider)
{
var settings = settingsProvider.Load();
this.ExecutablePath = settings.BrowserExecutablePath;
this.ExecutableArguments = settings.BrowserExecutableArguments;
}
示例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);
}
示例13: SolutionPackageRepositoryPath
public SolutionPackageRepositoryPath (
ISolution solution,
ISettingsProvider settingsProvider)
{
this.solution = solution;
PackageRepositoryPath = GetSolutionPackageRepositoryPath (settingsProvider);
}
示例14: EventLogFilterRepo
public EventLogFilterRepo(ISettingsProvider settingsProvider, IEventRecordTimeSpanSearcher eventRecordTimeSpanSearcher, ICacheLayer sweetCacheLayer)
{
EventLogCache = sweetCacheLayer;
ListOfServersToQuery = settingsProvider.ServersToQuery;
SearchTermsList = settingsProvider.FilterTerm;
EventRTimeSearcher = eventRecordTimeSpanSearcher;
}
示例15: TagsController
public TagsController(ITagRepository tagRepository, ISettingsProvider settingsProvider)
{
_tagRepository = tagRepository;
_settingsProvider = settingsProvider;
PageSize = _settingsProvider.GetSettings().PageSize;
}