Removed untyped contructor from ComponentRegistration and add a protected setter.
[castle.git] / AspectSharp / AspectSharp.Lang / AST / TargetTypeDefinition.cs
blob24245e53f9c556038f81629c6fea27f7fcb99bcb
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 AspectSharp.Lang.AST
17 using System;
19 public enum TargetStrategyEnum
21 Undefined,
22 SingleType,
23 Namespace,
24 Assignable,
25 Custom
28 /// <summary>
29 /// Summary description for TargetTypeDefinition.
30 /// </summary>
31 [Serializable]
32 public class TargetTypeDefinition : NodeBase
34 private TypeReference _singleType;
35 private String _namespaceRoot;
36 private TypeReferenceCollection _excludes;
37 private TargetStrategyEnum _strategy = TargetStrategyEnum.Undefined;
38 private TypeReference _customMatcherType;
39 private TypeReference _assignType;
40 private bool _includeSubNamespace = false;
42 public TargetTypeDefinition( TypeReference typeRef ) : this()
44 SingleType = typeRef;
47 public TargetTypeDefinition()
49 _strategy = TargetStrategyEnum.SingleType;
52 public TypeReference SingleType
54 get { return _singleType; }
55 set { _singleType = value; }
58 public TypeReference CustomMatcherType
60 get { return _customMatcherType; }
61 set { _customMatcherType = value; }
64 public TypeReference AssignType
66 get { return _assignType; }
67 set { _assignType = value; }
70 public TargetStrategyEnum TargetStrategy
72 get { return _strategy; }
73 set { _strategy = value; }
76 public String NamespaceRoot
78 get { return _namespaceRoot; }
79 set { _namespaceRoot = value; }
82 public bool IncludeSubNamespace
84 get { return _includeSubNamespace; }
85 set { _includeSubNamespace = value; }
88 public TypeReferenceCollection Excludes
90 get
92 if (_excludes == null)
94 _excludes = new TypeReferenceCollection();
96 return _excludes;
100 public override void Accept(IVisitor visitor)
102 visitor.OnTargetTypeDefinition(this);