1 // Copyright 2004-2008 Castle Project - http://www.castleproject.org/
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
7 // http://www.apache.org/licenses/LICENSE-2.0
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 language governing permissions and
13 // limitations under the License.
15 namespace Castle
.MicroKernel
.Registration
18 using Castle
.Core
.Configuration
;
21 /// Represents a configuration parameter.
23 public class Parameter
25 private readonly String key
;
26 private readonly String
value;
27 private readonly IConfiguration configNode
;
29 internal Parameter(String key
, String
value)
35 internal Parameter(String key
, IConfiguration configNode
)
38 this.configNode
= configNode
;
42 /// Gets the parameter key.
50 /// Gets the parameter value.
58 /// Gets the parameter configuration.
60 public IConfiguration ConfigNode
62 get { return configNode; }
66 /// Create a <see cref="ParameterKey"/> with key.
68 /// <param name="key">The parameter key.</param>
69 /// <returns>The new <see cref="ParameterKey"/></returns>
70 public static ParameterKey
ForKey(String key
)
72 return new ParameterKey(key
);
79 /// Represents a parameter key.
81 public class ParameterKey
83 private readonly String name
;
85 internal ParameterKey(String name
)
91 /// The parameter key name.
99 /// Builds the <see cref="Parameter"/> with key/value.
101 /// <param name="value">The parameter value.</param>
102 /// <returns>The new <see cref="Parameter"/></returns>
103 public Parameter
Eq(String
value)
105 return new Parameter(name
, value);
109 /// Builds the <see cref="Parameter"/> with key/config.
111 /// <param name="configNode">The parameter configuration.</param>
112 /// <returns>The new <see cref="Parameter"/></returns>
113 public Parameter
Eq(IConfiguration configNode
)
115 return new Parameter(name
, configNode
);