// Copyright (c) AlphaSierraPapa for the SharpDevelop Team (for details please see \doc\copyright.txt) // This code is distributed under the GNU LGPL (for details please see \doc\license.txt) using System; using System.Collections.Generic; namespace ICSharpCode.SharpDevelop.Dom { public interface IEntity : ICompletionEntry, IFreezable, IComparable { string FullyQualifiedName { get; } string Namespace { get; } /// /// The fully qualified name in the internal .NET notation (with `1 for generic types) /// string DotNetName { get; } DomRegion BodyRegion { get; } /// /// Gets the declaring type. /// For members, this is the type that contains the member. /// For classes, this is the outer class (for nested classes), or null if there this /// is a top-level class. /// IClass DeclaringType { get; } ModifierEnum Modifiers { get; } IList Attributes { get; } string Documentation { get; } /// /// Returns true if this entity has the 'abstract' modifier set. /// (Returns false for interface members). /// bool IsAbstract { get; } bool IsSealed { get; } /// /// Gets whether this entity is static. /// Returns true if either the 'static' or the 'const' modifier is set. /// bool IsStatic { get; } /// /// Gets whether this entity is a constant (C#-like const). /// bool IsConst { get; } /// /// Gets if the member is virtual. Is true only if the "virtual" modifier was used, but non-virtual /// members can be overridden, too; if they are already overriding a method. /// bool IsVirtual { get; } bool IsPublic { get; } bool IsProtected { get; } bool IsPrivate { get; } bool IsInternal { get; } bool IsReadonly { get; } [Obsolete("This property does not do what one would expect - it merely checks if protected+internal are set, it is not the equivalent of AssemblyAndFamily in Reflection!")] bool IsProtectedAndInternal { get; } [Obsolete("This property does not do what one would expect - it merely checks if one of protected+internal is set, it is not the equivalent of AssemblyOrFamily in Reflection!")] bool IsProtectedOrInternal { get; } bool IsOverride { get; } /// /// Gets if the member can be overridden. Returns true when the member is "virtual" or "override" but not "sealed". /// bool IsOverridable { get; } bool IsNew { get; } bool IsSynthetic { get; } /// /// Gets the compilation unit that contains this entity. /// ICompilationUnit CompilationUnit { get; } /// /// The project content in which this entity is defined. /// IProjectContent ProjectContent { get; } /// /// This property can be used to attach any user-defined data to this class/method. /// This property is mutable, it can be changed when the class/method is frozen. /// object UserData { get; set; } EntityType EntityType { get; } bool IsAccessible(IClass callingClass, bool isAccessThoughReferenceOfCurrentClass); } public enum EntityType { Class, Field, Property, Method, Event } }