Added RedirectUsingNamedRoute
[castle.git] / Core / Castle.Core / Attributes / ComponentProxyBehaviorAttribute.cs
blobf24a1e27576bfc81beb37e2417d7bb47987088c7
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.Core
17 using System;
19 /// <summary>
20 /// Specifies the proxying behavior for a component.
21 /// </summary>
22 [AttributeUsage(AttributeTargets.Class, AllowMultiple = false)]
23 public class ComponentProxyBehaviorAttribute : Attribute
25 private bool useSingleInterfaceProxy;
26 private bool useMarshalByRefProxy;
27 private Type[] additionalInterfaces;
29 /// <summary>
30 /// Initializes a new instance of the <see cref="ComponentProxyBehaviorAttribute"/> class.
31 /// </summary>
32 public ComponentProxyBehaviorAttribute()
36 /// <summary>
37 /// Gets or sets a value indicating whether the generated
38 /// interface proxy should inherit from <see cref="MarshalByRefObject"/>.
39 /// </summary>
40 public bool UseMarshalByRefProxy
42 get { return useMarshalByRefProxy; }
43 set { useMarshalByRefProxy = value; }
46 /// <summary>
47 /// Determines if the component requires a single interface proxy.
48 /// </summary>
49 /// <value><c>true</c> if the component requires a single interface proxy.</value>
50 public bool UseSingleInterfaceProxy
52 get { return useSingleInterfaceProxy; }
53 set { useSingleInterfaceProxy = value; }
56 /// <summary>
57 /// Gets or sets the additional interfaces used during proxy generation.
58 /// </summary>
59 public Type[] AdditionalInterfaces
61 get
63 if (additionalInterfaces != null)
65 return additionalInterfaces;
68 return Type.EmptyTypes;
70 set { additionalInterfaces = value; }