1
// Copyright (c) AlphaSierraPapa for the SharpDevelop Team (for details please see \doc\copyright.txt)
2
// This code is distributed under the GNU LGPL (for details please see \doc\license.txt)
5
using System.Collections.Generic;
7
namespace ICSharpCode.SharpDevelop.Dom
9
public abstract class AbstractMember : AbstractEntity, IMember
11
IReturnType returnType;
13
IList<ExplicitInterfaceImplementation> interfaceImplementations;
14
IReturnType declaringTypeReference;
16
protected override void FreezeInternal()
18
interfaceImplementations = FreezeList(interfaceImplementations);
19
base.FreezeInternal();
22
public sealed override ICompilationUnit CompilationUnit {
23
[System.Diagnostics.DebuggerStepThrough]
25
return this.DeclaringType.CompilationUnit;
29
public virtual DomRegion Region {
34
CheckBeforeMutation();
39
public virtual IReturnType ReturnType {
44
CheckBeforeMutation();
50
/// Gets the declaring type reference (declaring type incl. type arguments)
52
public virtual IReturnType DeclaringTypeReference {
54
return declaringTypeReference ?? this.DeclaringType.DefaultReturnType;
57
CheckBeforeMutation();
58
declaringTypeReference = value;
62
public IList<ExplicitInterfaceImplementation> InterfaceImplementations {
64
return interfaceImplementations ?? (interfaceImplementations = new List<ExplicitInterfaceImplementation>());
68
public AbstractMember(IClass declaringType, string name) : base(declaringType, name)
70
// members must have a parent class
71
if (declaringType == null)
72
throw new ArgumentNullException("declaringType");
75
public abstract IMember Clone();
77
object ICloneable.Clone()
82
public override string Documentation {
84
if (genericMember != null)
85
return genericMember.Documentation;
86
return base.Documentation;
89
base.Documentation = value;
93
IMember genericMember;
95
public virtual IMember GenericMember {
96
get { return genericMember; }
99
public virtual IMember CreateSpecializedMember()
101
AbstractMember copy = Clone() as AbstractMember;
103
throw new Exception("Clone() must return an AbstractMember instance, or CreateSpecializedMember must also be overridden.");
104
copy.genericMember = this;