Fixing an issue with output parameters that are of type IntPtr
[castle.git] / ActiveRecord / Castle.ActiveRecord / Framework / Internal / Model / AnyModel.cs
blob72173c9a0b0444325545f8b8a463e336ce1222b1
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.Collections.Generic;
19 using System.Reflection;
21 using Castle.ActiveRecord;
23 /// <summary>
24 /// Model for [Any] association, a polymorphic association without common base class
25 /// </summary>
26 [Serializable]
27 public class AnyModel : IVisitable
29 private readonly PropertyInfo prop;
30 private readonly AnyAttribute anyAtt;
31 private IList<Any.MetaValueAttribute> metaValues;
33 /// <summary>
34 /// Initializes a new instance of the <see cref="AnyModel"/> class.
35 /// </summary>
36 /// <param name="prop">The prop.</param>
37 /// <param name="anyAtt">Any att.</param>
38 public AnyModel(PropertyInfo prop, AnyAttribute anyAtt)
40 this.prop = prop;
41 this.anyAtt = anyAtt;
42 metaValues = new List<Any.MetaValueAttribute>();
45 /// <summary>
46 /// Gets the property.
47 /// </summary>
48 /// <value>The property.</value>
49 public PropertyInfo Property
51 get { return prop; }
54 /// <summary>
55 /// Gets the [Any] attribute
56 /// </summary>
57 /// <value>Any att.</value>
58 public AnyAttribute AnyAtt
60 get { return anyAtt; }
63 /// <summary>
64 /// Gets or sets the meta values.
65 /// </summary>
66 /// <value>The meta values.</value>
67 public IList<Any.MetaValueAttribute> MetaValues
69 get { return metaValues; }
70 set { metaValues = value; }
73 #region IVisitable Members
75 /// <summary>
76 /// Accepts the specified visitor and call the relevant IVisitor.Visit***() method
77 /// </summary>
78 /// <param name="visitor">The visitor.</param>
79 public void Accept(IVisitor visitor)
81 visitor.VisitAny(this);
84 #endregion