ITypeDefinition Interface

From The Oxygene Language Wiki

Jump to:navigation, search

This is a Language topic
Feel free to add your notes to this topic below.


ITypeDefinition = public interface (ITypeReference, IType, IAttributeDefinitionProvider, 
  IAttributesProvider, IGenericParametersProvider, IElementDefinition, IPosition)

ITypeDefinition is a class, record, delegate or enum type defined in the current project. This interface can be used to add new members to this type or modify existing ones. To query the members of this type, use the IType Interface.

Namespace: Cirrus


Members

Method
Description
AddConstant(aName: String; aType: IType): IConstantDefinitionAdds a new constant
AddConstructor(aStatic: Boolean): IMethodDefinitionAdds a new constructor to this class
AddEvent(aName: String; aType: IType; aStatic: Boolean): IEventDefinitionAdds a new event
AddField(aName: String; aType: IType; aStatic: Boolean): IFieldDefinitionAdds a new field
AddFinalizer: IMethodDefinitionAdds a finalizer to the method list
AddImplements(IMethodDefinition; aInterface: IType; aInterfaceMethod: IMethod): IImplementsAdds a new method implements
AddInterface(aInterface: IType)Adds a new implemented interface to this class
AddMethod(aName: String; aType: IType; aStatic: Boolean): IMethodDefinitionAdds a new method to this class
AddOperator(anOp: BinaryOperator; aParam1, aParam2, aResult: IType):IMethodDefinitionAdds a new binary operator overload to this class
AddOperator(anOp: UnaryOperator, aParam, aResult: IType): IMethodDefinitionAdds a new unary operator overload to this class
AddProperty(aName: String; aType: IType; aStatic: Boolean):IPropertyDefinitionAdds a new property to this class
FindContextType(aName: String): ITypeFinds a type that is valid in the context of this method; this supports passing strings like "Array of String" and "System.Collections.Generic.List<class 0;> to create generic types. "method 0" is the first method generic parameter
GetContextType(aName: String): ITypeFor more info on the syntax
GetEvent(no: Integer): IEventDefinitionReturns an event by index
GetField(no: Integer):IFieldDefinitionReturns a field by index (includes constants)
GetMethod(no: Integer): IMethodDefinitionReturns a method by index, includes constructors and operators
GetProperty(no: Integer): IPropertyDefinitionReturns a property by index
GetSelfType: ITypeReturns the self type of the type this method is in, for generic types this is a generic type instantiated with its own parameters
GetUniqueIdentifier(aBaseName: string): stringGenerates an identifier that is not used by the user or compiler
RemoveEvent(anEvent: IEventDefinition)Removes an event definition from the events list in this class
RemoveEvent(no: Integer)Removes an event definition from the events list in this class
RemoveField(aField: IFieldDefinition)Removes a field from the field list in this class
RemoveField(no: Integer)Removes a field from the field list in this class
RemoveImplements(aImplements: IImplements)Removes an implements definition from this class
RemoveImplements(no: Integer)Removes an implements definition from this class
RemoveInterface(anInterface: IType)Removes an implemented interface from this type
RemoveInterface(no: Integer)Removes an implemented interface from this type
RemoveMethod(aMethod: IMethodDefinition)Removes a method from this type
RemoveMethod(no: Integer)Removes a method from this type
RemoveProperty(aProperty: IPropertyDefinition)Removes a property from this type
RemoveProperty(no: Integer)Removes a property from this type
SetName(aNamespace, aName: String)Sets the name of this type


Properties

Property
Description
EnumUnderlyingType: IType InterfaceGets or sets the underlying type of this enum
EventCount: IntegerReturns the number of events in this class
FieldCount: IntegerReturns the number of fields and constants in this type
MethodCount: IntegerReturns the number of methods in this type
ParentType: IType InterfaceThe parent type of this type
PropertyCount: IntegerReturns the number of properties in this class
Sealed: BooleanGets or sets if this class is sealed
Visibility: VisibilityNested visibility; for non-nested types only private and public are valid


See Also

Oxygene-48.png

Area: Oxygene Language
Compiler version: Oxygene 5

Language GlossaryKeywordsTypesFAQHow To

Navigation
Areas
More
Toolbox