public Attribute ( string name, string value ) : |
||
name | string | |
value | string | |
return |
/// <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; }
protected override void PopulateBusConfiguration(MutableConfiguration busConfig) { base.PopulateBusConfiguration(busConfig); if (string.IsNullOrEmpty(Path) == false) busConfig.Attribute("path", Path); }
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); }
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); }
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; }
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); }