Fixing an issue with output parameters that are of type IntPtr
[castle.git] / ActiveRecord / Castle.ActiveRecord / Framework / Internal / Model / NestedModel.cs
blob43e8ed9dd7a92b330f4ddb6feb305866064dc404
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 language governing permissions and
13 // limitations under the License.
15 namespace Castle.ActiveRecord.Framework.Internal
17 using System;
18 using System.Reflection;
20 /// <summary>
21 /// This model is used to represent a nested value type (&lt;component/&gt; - in NHibernate talk).
22 /// </summary>
23 [Serializable]
24 public class NestedModel : IVisitable
26 private readonly PropertyInfo propInfo;
27 private readonly NestedAttribute nestedAtt;
28 private readonly ActiveRecordModel nestedModel;
30 /// <summary>
31 /// Initializes a new instance of the <see cref="NestedModel"/> class.
32 /// </summary>
33 /// <param name="propInfo">The prop info.</param>
34 /// <param name="nestedAtt">The nested att.</param>
35 /// <param name="nestedModel">The nested model.</param>
36 public NestedModel( PropertyInfo propInfo, NestedAttribute nestedAtt, ActiveRecordModel nestedModel )
38 this.nestedAtt = nestedAtt;
39 this.nestedModel = nestedModel;
40 this.propInfo = propInfo;
43 /// <summary>
44 /// Gets the model.
45 /// </summary>
46 /// <value>The model.</value>
47 public ActiveRecordModel Model
49 get { return nestedModel; }
52 /// <summary>
53 /// Gets the property.
54 /// </summary>
55 /// <value>The property.</value>
56 public PropertyInfo Property
58 get { return propInfo; }
61 /// <summary>
62 /// Gets the nested attribute
63 /// </summary>
64 /// <value>The nested att.</value>
65 public NestedAttribute NestedAtt
67 get { return nestedAtt; }
70 #region IVisitable Members
72 /// <summary>
73 /// Accepts the specified visitor and call the relevant IVisitor.Visit***() method
74 /// </summary>
75 /// <param name="visitor">The visitor.</param>
76 public void Accept(IVisitor visitor)
78 visitor.VisitNested(this);
81 #endregion