InterfaceDeclaration Class
Represents an interface declaration.
public class InterfaceDeclaration : TypeDeclaration, IMemberContainer, IParametrableType, ITypeDeclarationContainerExample
var iface = new InterfaceDeclaration("IRepository");
var typeParameter = new TypeParameter("T");
iface.Parameters.Add(typeParameter);
iface.Members.Add(new MethodDeclaration("Get") { ReturnType = typeParameter });
var code = iface.ToCsharpString();
Assert.StartsWith("interface IRepository<T>", code);
Assert.Contains("Get();", code);- Inheritance
TypeDeclarationInterfaceDeclaration- Implements
Constructors
| Name | Description |
|---|---|
| InterfaceDeclaration() | |
| InterfaceDeclaration(string?) | Initializes a new instance of the InterfaceDeclaration class with the specified name. |
InterfaceDeclaration overloads
InterfaceDeclaration()
InterfaceDeclaration.cspublic InterfaceDeclaration()No documentation is available.
InterfaceDeclaration(string?)
InterfaceDeclaration.csInitializes a new instance of the InterfaceDeclaration class with the specified name.
public InterfaceDeclaration(string? name)Parameters
namestring?- The interface name.
Properties
| Name | Description |
|---|---|
| BaseType | |
| Implements | |
| Members | |
| Parameters | |
| Types |
BaseType
InterfaceDeclaration.csImplements
InterfaceDeclaration.csMembers
InterfaceDeclaration.cspublic CodeObjectCollection<MemberDeclaration> Members { get; }Property value
No documentation is available.
Parameters
InterfaceDeclaration.cspublic CodeObjectCollection<TypeParameter> Parameters { get; }Property value
No documentation is available.
public CodeObjectCollection<TypeDeclaration> Types { get; }Property value
No documentation is available.