Fixing an issue with output parameters that are of type IntPtr
[castle.git] / InversionOfControl / Castle.Windsor / Installer / PartialConfigurationStore.cs
blob56c5e36ac6fa66b1070a78c9fd1829ddbbb034e5
1 // Copyright 2004-2008 Castle Project - http://www.castleproject.org/
2 //
3 // Licensed under the Apache License, Version 2.0 (the "License");
4 // you may not use this file except in compliance with the License.
5 // You may obtain a copy of the License at
6 //
7 // http://www.apache.org/licenses/LICENSE-2.0
8 //
9 // Unless required by applicable law or agreed to in writing, software
10 // distributed under the License is distributed on an "AS IS" BASIS,
11 // WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
12 // See the License for the specific la
14 namespace Castle.Windsor.Installer
16 using System;
17 using Castle.Core.Configuration;
18 using Castle.Core.Resource;
19 using Castle.MicroKernel;
20 using Castle.MicroKernel.SubSystems.Configuration;
22 internal class PartialConfigurationStore : IConfigurationStore, IDisposable
24 private readonly IConfigurationStore inner;
25 private readonly IConfigurationStore partial;
27 public PartialConfigurationStore(IKernel kernel)
29 inner = kernel.ConfigurationStore;
30 partial = new DefaultConfigurationStore();
31 partial.Init(kernel);
34 #region IConfigurationStore Members
36 public void AddFacilityConfiguration(String key, IConfiguration config)
38 inner.AddFacilityConfiguration(key, config);
39 partial.AddFacilityConfiguration(key, config);
42 public void AddComponentConfiguration(String key, IConfiguration config)
44 inner.AddComponentConfiguration(key, config);
45 partial.AddComponentConfiguration(key, config);
48 public void AddBootstrapComponentConfiguration(String key, IConfiguration config)
50 inner.AddBootstrapComponentConfiguration(key, config);
51 partial.AddBootstrapComponentConfiguration(key, config);
54 public void AddChildContainerConfiguration(String name, IConfiguration config)
56 inner.AddChildContainerConfiguration(name, config);
57 partial.AddChildContainerConfiguration(name, config);
60 public IConfiguration GetChildContainerConfiguration(String key)
62 return partial.GetChildContainerConfiguration( key );
65 public IConfiguration GetFacilityConfiguration(String key)
67 return partial.GetFacilityConfiguration(key);
70 public IConfiguration GetComponentConfiguration(String key)
72 return partial.GetComponentConfiguration(key);
75 public IConfiguration GetBootstrapComponentConfiguration(String key)
77 return partial.GetBootstrapComponentConfiguration(key);
80 public IConfiguration[] GetFacilities()
82 return partial.GetFacilities();
85 public IConfiguration[] GetComponents()
87 return partial.GetComponents();
90 public IConfiguration[] GetBootstrapComponents()
92 return partial.GetBootstrapComponents();
95 public IConfiguration[] GetConfigurationForChildContainers()
97 return partial.GetConfigurationForChildContainers();
100 public IResource GetResource(String resourceUri, IResource resource)
102 return inner.GetResource(resourceUri, resource);
105 #endregion
107 #region ISubSystem Members
109 public void Init(IKernel kernel)
111 partial.Init(kernel);
114 public void Terminate()
116 partial.Terminate();
119 #endregion
121 #region IDisposable Members
123 public void Dispose()
125 Terminate();
128 #endregion