本文整理汇总了C#中Castle.Core.Configuration.MutableConfiguration.Attribute方法的典型用法代码示例。如果您正苦于以下问题:C# MutableConfiguration.Attribute方法的具体用法?C# MutableConfiguration.Attribute怎么用?C# MutableConfiguration.Attribute使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类Castle.Core.Configuration.MutableConfiguration
的用法示例。
在下文中一共展示了MutableConfiguration.Attribute方法的6个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C#代码示例。
示例1: Build
/// <summary>
///
/// </summary>
/// <returns></returns>
public IConfiguration Build()
{
var facilityConfiguraiton = new MutableConfiguration("facility");
facilityConfiguraiton.Attribute("id", this.id);
facilityConfiguraiton.Attribute("type", typeof(NHibernateFacility).FullName);
foreach (var factoryConfiguration in factoryConfigurations)
{
var config=factoryConfiguration.Build();
facilityConfiguraiton.Children.Add(config);
}
return facilityConfiguraiton;
}
示例2: PopulateBusConfiguration
protected override void PopulateBusConfiguration(MutableConfiguration busConfig)
{
base.PopulateBusConfiguration(busConfig);
if (string.IsNullOrEmpty(Path) == false)
busConfig.Attribute("path", Path);
}
示例3: InvalidProtocol_throws
public void InvalidProtocol_throws() {
var configStore = new DefaultConfigurationStore();
var configuration = new MutableConfiguration("facility");
configuration.Attribute("type", typeof(SolrNetFacility).AssemblyQualifiedName);
configuration.CreateChild("solrURL", "ftp://localhost");
configStore.AddFacilityConfiguration(typeof(SolrNetFacility).FullName, configuration);
new WindsorContainer(configStore);
}
示例4: Ping_Query
public void Ping_Query()
{
var configStore = new DefaultConfigurationStore();
var configuration = new MutableConfiguration("facility");
configuration.Attribute("type", typeof(SolrNetFacility).AssemblyQualifiedName);
configuration.CreateChild("solrURL", "http://localhost:8983/solr");
configStore.AddFacilityConfiguration(typeof(SolrNetFacility).FullName, configuration);
var container = new WindsorContainer(configStore);
var solr = container.Resolve<ISolrOperations<CastleFixture.Document>>();
solr.Ping();
Console.WriteLine(solr.Query(SolrQuery.All).Count);
}
示例5: GetFacilityConfig
private MutableConfiguration GetFacilityConfig(IApplication application)
{
var currentEnvironment = EnumHelper.GetKey(application.Environment);
var allEnvironments = EnumHelper.GetKeys<Environment>();
var facilityConfig = new MutableConfiguration("facility");
if (HttpContext.Current != null)
{
facilityConfig.Attribute("isWeb", bool.TrueString);
}
foreach (var config in application.DatabaseConfiguration)
{
if (complexConfigurationPattern.IsMatch(config.Key))
{
var match = complexConfigurationPattern.Match(config.Key);
var environment = match.Groups[1].Value;
var alias = match.Groups[2].Value;
if (currentEnvironment.Equals(environment))
{
AddFactory(facilityConfig, alias);
}
}
else
{
if (currentEnvironment.Equals(config.Key))
{
AddDefaultFactory(facilityConfig);
}
else
{
if (!Enumerable.Contains(allEnvironments, config.Key))
{
var alias = config.Key;
var environmentSpecific = String.Format(EnvironmentSpecificTemplate, currentEnvironment, alias);
if (!application.DatabaseConfiguration.ContainsKey(environmentSpecific))
{
AddFactory(facilityConfig, alias);
}
}
}
}
}
return facilityConfig;
}
示例6: PopulateBusConfiguration
protected virtual void PopulateBusConfiguration(MutableConfiguration busConfig)
{
busConfig
.Attribute("endpoint", Endpoint)
.Attribute("threadCount", ThreadCount.ToString())
.Attribute("numberOfRetries", NumberOfRetries.ToString());
if (string.IsNullOrEmpty(Name) == false)
busConfig.Attribute("name", Name);
if (string.IsNullOrEmpty(LoadBalancerEndpoint) == false)
busConfig.Attribute("loadBalancerEndpoint", LoadBalancerEndpoint);
if (string.IsNullOrEmpty(LogEndpoint) == false)
busConfig.Attribute("logEndpoint", LogEndpoint);
}