1 // Copyright 2004-2008 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.
20 /// Specifies the proxying behavior for a component.
22 [AttributeUsage(AttributeTargets
.Class
, AllowMultiple
= false)]
23 public class ComponentProxyBehaviorAttribute
: Attribute
25 private bool useSingleInterfaceProxy
;
26 private bool useMarshalByRefProxy
;
27 private Type
[] additionalInterfaces
;
30 /// Initializes a new instance of the <see cref="ComponentProxyBehaviorAttribute"/> class.
32 public ComponentProxyBehaviorAttribute()
37 /// Gets or sets a value indicating whether the generated
38 /// interface proxy should inherit from <see cref="MarshalByRefObject"/>.
40 public bool UseMarshalByRefProxy
42 get { return useMarshalByRefProxy; }
43 set { useMarshalByRefProxy = value; }
47 /// Determines if the component requires a single interface proxy.
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; }
57 /// Gets or sets the additional interfaces used during proxy generation.
59 public Type
[] AdditionalInterfaces
63 if (additionalInterfaces
!= null)
65 return additionalInterfaces
;
68 return Type
.EmptyTypes
;
70 set { additionalInterfaces = value; }