1 // Copyright 2004-2007 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
.MonoRail
.Framework
.Configuration
18 using System
.Configuration
;
23 /// Represents the Scaffolding support configuration.
24 /// <seealso cref="IScaffoldingSupport"/>
26 public class ScaffoldConfig
: ISerializedConfig
28 private Type scaffoldImplType
;
30 #region ISerializedConfig implementation
33 /// Deserializes the configuration section looking
34 /// for a 'scaffold' element with a 'type' attribute
36 /// <param name="section">The section.</param>
37 public void Deserialize(XmlNode section
)
39 section
= section
.SelectSingleNode("scaffold");
41 if (section
== null) return;
43 XmlAttribute typeAtt
= section
.Attributes
["type"];
45 if (typeAtt
== null || typeAtt
.Value
== String
.Empty
)
47 String message
= "Please specify the 'type' attribute to define an implementation for scaffolding support";
48 throw new ConfigurationErrorsException(message
);
51 scaffoldImplType
= TypeLoadUtil
.GetType(typeAtt
.Value
);
57 /// Gets the scaffolding support implementation type.
58 /// <seealso cref="IScaffoldingSupport"/>
60 /// <value>The type of the scaffold impl.</value>
61 public Type ScaffoldImplType
63 get { return scaffoldImplType; }