Fixing an issue with output parameters that are of type IntPtr
[castle.git] / ActiveRecord / Castle.ActiveRecord / Attributes / ImportAttribute.cs
blob370306c5948aa6f0194ff89a783a36fbf7dc0d94
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
17 using System;
18 using Castle.ActiveRecord.Queries;
20 /// <summary>
21 /// This is used to map between a type to a friendly name that can be used in the queries.
22 ///
23 /// This attribute is representing an &lt;import/&gt; in the mapping files
24 /// </summary>
25 /// <example>
26 /// [Import(typeof(SummaryRow), "summary")]
27 /// </example>
28 [AttributeUsage(AttributeTargets.Class | AttributeTargets.Assembly, AllowMultiple = true), Serializable]
29 public class ImportAttribute : Attribute
31 private readonly Type type;
32 private String rename;
34 /// <summary>
35 /// Initializes a new instance of the <see cref="ImportAttribute"/> class.
36 /// </summary>
37 /// <param name="type">The type.</param>
38 /// <param name="rename">The rename.</param>
39 public ImportAttribute(Type type, string rename)
41 this.type = type;
42 this.rename = rename;
45 /// <summary>
46 /// Gets the type that is being imported
47 /// </summary>
48 /// <value>The type.</value>
49 public Type Type
51 get { return this.type; }
54 /// <summary>
55 /// Gets or sets the renamed string that will replace the full type name in HQL queries for the specified type.
56 /// </summary>
57 /// <value>The renamed value.</value>
58 public String Rename
60 get { return rename; }
61 set { rename = value; }