1 // Copyright 2004-2007 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.
15 namespace AspectSharp
.Lang
.AST
19 public enum TargetTypeEnum
27 /// Summary description for TypeReference.
30 public class TypeReference
: NodeBase
32 private String _typeName
;
33 private String _linkRef
;
34 private AssemblyReference _assembly
;
35 private TargetTypeEnum _targetType
= TargetTypeEnum
.Undefined
;
36 private Type _resolvedType
;
38 public TypeReference()
42 public TypeReference(LexicalInfo info
) : base(info
)
46 public TypeReference(LexicalInfo info
, String typeName
) : this(info
)
51 public TypeReference(LexicalInfo info
, String
value, TargetTypeEnum targetType
) : this(info
)
53 if (targetType
== TargetTypeEnum
.Link
)
63 public TargetTypeEnum TargetType
65 get { return _targetType; }
68 public string TypeName
70 get { return _typeName; }
71 set { _typeName = value; _targetType = TargetTypeEnum.Type; }
76 get { return _linkRef; }
77 set { _linkRef = value; _targetType = TargetTypeEnum.Link; }
80 public AssemblyReference AssemblyReference
82 get { return _assembly; }
83 set { _assembly = value; }
86 public Type ResolvedType
88 get { return _resolvedType; }
89 set { _resolvedType = value; }
92 public override void Accept(IVisitor visitor
)
94 visitor
.OnTypeReferenceDefinition(this);
97 public override String
ToString()
99 return _typeName
!= null ? _typeName
: _linkRef
;