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
);
77 /// Represents a parameter key.
79 public class ParameterKey
81 private readonly String name
;
83 internal ParameterKey(String name
)
89 /// The parameter key name.
97 /// Builds the <see cref="Parameter"/> with key/value.
99 /// <param name="value">The parameter value.</param>
100 /// <returns>The new <see cref="Parameter"/></returns>
101 public Parameter
Eq(String
value)
103 return new Parameter(name
, value);
107 /// Builds the <see cref="Parameter"/> with key/config.
109 /// <param name="configNode">The parameter configuration.</param>
110 /// <returns>The new <see cref="Parameter"/></returns>
111 public Parameter
Eq(IConfiguration configNode
)
113 return new Parameter(name
, configNode
);