本文整理汇总了C#中IConfigurationManager类的典型用法代码示例。如果您正苦于以下问题:C# IConfigurationManager类的具体用法?C# IConfigurationManager怎么用?C# IConfigurationManager使用的例子?那么恭喜您, 这里精选的类代码示例或许可以为您提供帮助。
IConfigurationManager类属于命名空间,在下文中一共展示了IConfigurationManager类的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C#代码示例。
示例1: UrlController
public UrlController(IConfigurationManager configurationManager,
IConfigurationRepository configRepository,
IFrontMatterRepository frontMatterRepository,
IMarkupProcessorFactory markupProcessorFactory)
: base(configurationManager)
{
if (configRepository == null)
{
throw new ArgumentNullException("configRepository");
}
if (frontMatterRepository == null)
{
throw new ArgumentNullException("frontMatterRepository");
}
if (markupProcessorFactory == null)
{
throw new ArgumentNullException("markupProcessorFactory");
}
ConfigRepository = configRepository;
FrontMatterRepository = frontMatterRepository;
MarkupProcessorFactory = markupProcessorFactory;
}
示例2: FileReport
public FileReport(IConfigurationManager configurationManager, IFileManager fileManager)
{
_configurationManager = configurationManager;
_fileManager = fileManager;
InitializeComponent();
}
示例3: DiagnosticsManager
internal DiagnosticsManager(IDebugLogService logService, IEventBus eventBus, IConfigurationManager configurationManager, ILogger logger)
{
_logService = logService;
_configurationManager = configurationManager;
eventBus.Subscribe<ErrorEvent>(HandleErrorEvent);
_logger = logger;
}
示例4: TraceLogger
public TraceLogger(IConfigurationManager logConfig)
{
ArgumentValidator.ValidateNonNullReference(logConfig,"logConfig","TraceLogger.Ctor()");
this._traceSource = new TraceSource(TraceSourceName) { Switch = new SourceSwitch(TraceSwitchName) };
LogLevel logLevel;
Enum.TryParse(logConfig.SystemConfiguration["LogLevel"], out logLevel);
switch (logLevel)
{
case LogLevel.Off:
this._traceSource.Switch.Level = SourceLevels.Off;
break;
case LogLevel.Critical:
this._traceSource.Switch.Level = SourceLevels.All;
break;
case LogLevel.Error:
this._traceSource.Switch.Level = SourceLevels.Critical | SourceLevels.Error;
break;
case LogLevel.Warning:
this._traceSource.Switch.Level = SourceLevels.Critical | SourceLevels.Error | SourceLevels.Warning;
break;
case LogLevel.Information:
this._traceSource.Switch.Level = SourceLevels.Critical | SourceLevels.Error | SourceLevels.Warning | SourceLevels.Information;
break;
case LogLevel.Verbose:
this._traceSource.Switch.Level = SourceLevels.Critical | SourceLevels.Error | SourceLevels.Warning | SourceLevels.Information | SourceLevels.Verbose;
break;
}
}
示例5: ThreadManager
public ThreadManager(IConfigurationManager<ConfigKey> configManager)
{
var threads = configManager.GetIntValue(ConfigKey.Threads);
_maxThreads = threads > 0 ? threads : (int?)null;
_runningThreads = 0;
_lock = new object();
}
示例6: BlogPostController
public BlogPostController(IMvcLogger logger, IAsyncDocumentSession documentSession, IConfigurationManager configManager, AkismetClient akismetClient, IMappingEngine mapper)
: base(logger, documentSession)
{
_configManager = configManager;
_akismetClient = akismetClient;
_mapper = mapper;
}
示例7: InternalDirectShowPlayer
//public URCOMLoader PrivateCom
//{
// get
// {
// return _privateCom;
// }
//}
public InternalDirectShowPlayer(
ILogManager logManager
, MainBaseForm hostForm
//, IPresentationManager presentation
//, ISessionManager sessionManager
, IApplicationPaths appPaths
, IIsoManager isoManager
//, IUserInputManager inputManager
, IZipClient zipClient
, IHttpClient httpClient, IConfigurationManager configurationManager)
{
_logger = logManager.GetLogger("InternalDirectShowPlayer");
_hostForm = hostForm;
//_presentation = presentation;
//_sessionManager = sessionManager;
_httpClient = httpClient;
_config = configurationManager;
_isoManager = isoManager;
//_inputManager = inputManager;
_zipClient = zipClient;
var config = GetConfiguration();
config.VideoConfig.SetDefaults();
config.AudioConfig.SetDefaults();
config.SubtitleConfig.SetDefaults();
config.COMConfig.SetDefaults();
//use a static object so we keep the libraries in the same place. Doesn't usually matter, but the EVR Presenter does some COM hooking that has problems if we change the lib address.
//if (_privateCom == null)
// _privateCom = new URCOMLoader(_config, _zipClient);
URCOMLoader.Instance.Initialize(appPaths.ProgramDataPath, _zipClient, logManager, configurationManager);
EnsureMediaFilters(appPaths.ProgramDataPath);
}
示例8: TextToSpeechNotifier
public TextToSpeechNotifier(ISpeechLibrary speechLibrary,
IConfigurationManager<TextToSpeechConfiguration> configurationManager)
{
_speechLibrary = speechLibrary;
_configurationManager = configurationManager;
_configFileInfo = new FileInfo(_configFileName);
}
示例9: CheckoutOrUpdate
public static void CheckoutOrUpdate(HttpApplication context, IConfigurationManager configurationManager, IRepositoryManager repositoryManager)
{
if (configurationManager == null)
{
throw new ArgumentNullException("configurationManager");
}
if (repositoryManager == null)
{
throw new ArgumentNullException("repositoryManager");
}
var repositoryUri = configurationManager.AppSettings["SiteRepositoryUri"];
var path = configurationManager.AppSettings["SitePath"];
if (!Path.IsPathRooted(path))
{
path = context.Server.MapPath(path);
}
try
{
repositoryManager.CheckoutOrUpdate(repositoryUri, path);
}
catch { }
}
示例10: MenuPresenter
public MenuPresenter(IMenuView view, IRepositoryFactory repositoryFactory, IConfigurationManager configurationManager, INavigator navigator)
{
_view = view;
_repositoryFactory = repositoryFactory;
_navigator = navigator;
_configurationManager = configurationManager;
}
示例11: DefaultModuleManager
public DefaultModuleManager(IIocManager iocManager, IModuleFinder moduleFinder, IConfigurationManager configurationManager)
{
_modules = new ModuleCollection();
_iocManager = iocManager;
_moduleFinder = moduleFinder;
_configurationManager = configurationManager;
}
示例12: Initialize
public virtual void Initialize(IDependencyResolver resolver)
{
if (resolver == null)
{
throw new ArgumentNullException("resolver");
}
if (_initialized)
{
return;
}
Pool = resolver.Resolve<IMemoryPool>();
MessageBus = resolver.Resolve<IMessageBus>();
JsonSerializer = resolver.Resolve<JsonSerializer>();
TraceManager = resolver.Resolve<ITraceManager>();
Counters = resolver.Resolve<IPerformanceCounterManager>();
AckHandler = resolver.Resolve<IAckHandler>();
ProtectedData = resolver.Resolve<IProtectedData>();
UserIdProvider = resolver.Resolve<IUserIdProvider>();
_configurationManager = resolver.Resolve<IConfigurationManager>();
_transportManager = resolver.Resolve<ITransportManager>();
// Ensure that this server is listening for any ACKs sent over the bus.
resolver.Resolve<AckSubscriber>();
_initialized = true;
}
示例13: ConnectionString
public ConnectionString(IConfigurationManager configuration, string name, string edmFilesPath,
string ssdlFileName, string csdlFileName, string mslFileName)
{
if(String.IsNullOrEmpty(edmFilesPath))
{
edmFilesPath=_demFilesPath;
}
if(String.IsNullOrEmpty(ssdlFileName))
{
ssdlFileName=_ssdlFileName;
}
if(String.IsNullOrEmpty(csdlFileName))
{
csdlFileName=_csdlFileName;
}
if(String.IsNullOrEmpty(mslFileName))
{
mslFileName=_mslFileName;
}
string providerConnectionString=configuration.GetConnectionString(name);
string providerName=configuration.GetProviderName(name);
string metadata = String.Format(CultureInfo.InvariantCulture,
_demMetadataFormat, edmFilesPath, csdlFileName, ssdlFileName, mslFileName);
_entityBuilder = new EntityConnectionStringBuilder
{
ProviderConnectionString = providerConnectionString,
Provider = providerName,
Metadata = metadata
};
}
示例14: CashFlowTypesViewModel
public CashFlowTypesViewModel(IShellViewModel shell, IDatabase database, IConfigurationManager configuration, ICachedService cashedService, IEventAggregator eventAggregator)
: base(shell, database, configuration, cashedService, eventAggregator)
{
SuppressEvent = false;
_cashFlows = new BindableCollectionExt<CashFlow>();
_cashFlows.PropertyChanged += (s, e) =>
{
OnPropertyChanged(s, e);
CachedService.Clear(CachedServiceKeys.AllCashFlows);
};
_cashFlowGroups = new BindableCollectionExt<CashFlowGroup>();
_cashFlowGroups.PropertyChanged += (s, e) =>
{
if (SuppressEvent == true)
{
return;
}
OnPropertyChanged(s, e);
CachedService.Clear(CachedServiceKeys.AllCashFlowGroups);
CachedService.Clear(CachedServiceKeys.AllCashFlows);
var cashFlowGroup = s as CashFlowGroup;
_cashFlows.Where(x => x.CashFlowGroupId == cashFlowGroup.Id)
.ForEach(x => x.Group = cashFlowGroup);
NewCashFlowGroup = null;
NewCashFlowGroup = CashFlowGroups.First();
};
}
示例15: AssertManagerEquivalence
/// <summary>
/// Asserts equivalence between two IConfigurationManager.
/// </summary>
/// <param name="a"></param>
/// <param name="b"></param>
public static void AssertManagerEquivalence( IConfigurationManager a, IConfigurationManager b )
{
if( a == null && b == null ) return;
Assert.That( a != null && b != null );
Assert.That( a.Layers.Count == b.Layers.Count );
for( int i = 0; i < a.Layers.Count; i++ )
{
// Consider equivalent if they're in the exact same order?
var layerA = a.Layers[i];
var layerB = b.Layers[i];
Assert.That( layerA.LayerName == layerB.LayerName );
foreach( var item in layerA.Items )
{
Assert.That( layerB.Items.Any( x => x.ServiceOrPluginFullName == item.ServiceOrPluginFullName && x.Status == item.Status ) );
}
}
if( a.FinalConfiguration != null )
{
Assert.That( b.FinalConfiguration != null );
Assert.That( a.FinalConfiguration.Items.Count == b.FinalConfiguration.Items.Count );
foreach( var item in a.FinalConfiguration.Items )
{
Assert.That( b.FinalConfiguration.Items.Any( x => x.ServiceOrPluginFullName == item.ServiceOrPluginFullName && x.Status == item.Status ) );
}
}
}