forked from hibernating-rhinos/rhino-esb
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathBusConfigurationSection.cs
51 lines (41 loc) · 1.56 KB
/
BusConfigurationSection.cs
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
using System.Configuration;
namespace Rhino.ServiceBus.Config
{
public class BusConfigurationSection : ConfigurationSection
{
public BusConfigurationSection()
{
SetupDefaults();
}
public BusElement Bus
{
get { return this["bus"] as BusElement; }
}
public LoadBalancerElement LoadBalancer
{
get { return this["loadBalancer"] as LoadBalancerElement; }
}
public SecurityElement Security
{
get { return this["security"] as SecurityElement; }
}
public MessageOwnerElementCollection MessageOwners
{
get { return this["messages"] as MessageOwnerElementCollection; }
}
[ConfigurationProperty("assemblies")]
public AssemblyElementCollection Assemblies
{
get { return this["assemblies"] as AssemblyElementCollection; }
set { this["assemblies"] = value; }
}
private void SetupDefaults()
{
Properties.Add(new ConfigurationProperty("security", typeof(SecurityElement), null));
Properties.Add(new ConfigurationProperty("bus", typeof(BusElement), null));
Properties.Add(new ConfigurationProperty("loadBalancer", typeof(LoadBalancerElement), null));
Properties.Add(new ConfigurationProperty("messages", typeof(MessageOwnerElementCollection), null));
Properties.Add(new ConfigurationProperty("assemblies", typeof(AssemblyElementCollection), null));
}
}
}