IMethodDefinition
Overview
A method definition interface is a reference to an in-code method. This interface allows the user to modify the method header and body.
Location
- Reference: RemObjects.Elements.Cirrus.dll
- Namespace: RemObjects.Elements.Cirrus
AddGenericParameter
add a generic parameter to this method
method AddGenericParameter(aName: String): IGenericParameterTypeDefinition
IGenericParameterTypeDefinition AddGenericParameter(String aName)
func AddGenericParameter(_ aName: String) -> IGenericParameterTypeDefinition
IGenericParameterTypeDefinition AddGenericParameter(String aName)
Function AddGenericParameter(aName As String) As IGenericParameterTypeDefinition
Parameters:
- aName: name
Adds a local variable to the locals list
Parameters:
- name: name of the local
- type: type of the local
Adds a local variable to the locals list. This local will not have a name (unless set later) and will not show up in the locals list during debugging
Parameters:
- type: type of the local
AddParameter
Adds a new parameter to this method
method AddParameter(name: String; mode: ParameterModifier; type: IType): IParameterDefinition
IParameterDefinition AddParameter(String name, ParameterModifier mode, IType type)
func AddParameter(_ name: String, _ mode: ParameterModifier, _ type: IType) -> IParameterDefinition
IParameterDefinition AddParameter(String name, ParameterModifier mode, IType type)
Function AddParameter(name As String, mode As ParameterModifier, type As IType) As IParameterDefinition
Parameters:
- name: name of the new parameter
- mode: parameter direction
- type: type of the new parameter
AddRaises
Add a new raises for this method
method AddRaises(type: IType)
void AddRaises(IType type)
func AddRaises(_ type: IType)
void AddRaises(IType type)
Sub AddRaises(type As IType)
Parameters:
- type: the raises to add
Async
Get or set the async bit for this method
property Async: Boolean read write;
Boolean Async { get; set; }
var Async: Boolean { get{} set{} }
Boolean Async { __get; __set; }
Property Async() As Boolean
CompilerGenerated
property CompilerGenerated: Boolean read write;
Boolean CompilerGenerated { get; set; }
var CompilerGenerated: Boolean { get{} set{} }
Boolean CompilerGenerated { __get; __set; }
Property CompilerGenerated() As Boolean
Convenience
property Convenience: Boolean read write;
Boolean Convenience { get; set; }
var Convenience: Boolean { get{} set{} }
Boolean Convenience { __get; __set; }
Property Convenience() As Boolean
Empty
If true, this method has no body (empty; modifier)
property Empty: Boolean read write;
Boolean Empty { get; set; }
var Empty: Boolean { get{} set{} }
Boolean Empty { __get; __set; }
Property Empty() As Boolean
External
If true, this method has no body and is marked as "external", usually used for pinvoke.
property External: Boolean read write;
Boolean External { get; set; }
var External: Boolean { get{} set{} }
Boolean External { __get; __set; }
Property External() As Boolean
Final
If true, this method is final and cannot be overridden
property Final: Boolean read write;
Boolean Final { get; set; }
var Final: Boolean { get{} set{} }
Boolean Final { __get; __set; }
Property Final() As Boolean
Returns a local by name, or fails with an exception if it is not found. Used by the compiler
Parameters:
- aName: name of the local to look for
Returns a local by name, or fails with an exception if it is not found. Used by the compiler
Parameters:
- aName: name of the local to look for
- aType: type to expect
Returns a local by name, or fails with an exception if it is not found. Used by the compiler
Parameters:
- no: index
Returns a parameter by name, or fails with an exception if it is not found. Used by the compiler
Parameters:
- aName: name of the parameter to look for
Returns a parameter by name, or fails with an exception if it is not found. Used by the compiler
Parameters:
- aName: name of the parameter to look for
- aType: type of the parameter to expect
GetParameterArrayValue
Returns an array with all parameters in it
method GetParameterArrayValue: ArrayValue
ArrayValue GetParameterArrayValue()
func GetParameterArrayValue() -> ArrayValue
ArrayValue GetParameterArrayValue()
Function GetParameterArrayValue() As ArrayValue
GetResult
Returns a value object for the result of this method.
method GetResult: Value
Value GetResult()
func GetResult() -> Value
Value GetResult()
Function GetResult() As Value
Returns a value object for the result of this method.
Parameters:
- aType: type
HasLocked
Returns true if this method has a locked modifier.
property HasLocked: Boolean read;
Boolean HasLocked { get; }
var HasLocked: Boolean { get{} }
Boolean HasLocked { __get; }
ReadOnly Property HasLocked() As Boolean
Inline
Returns true if this mehod has an inline modifier.
property Inline: Boolean read write;
Boolean Inline { get; set; }
var Inline: Boolean { get{} set{} }
Boolean Inline { __get; __set; }
Property Inline() As Boolean
Iterator
If true, this method is an iterator method. This can only be set from the *Interface interface callbacks.
property Iterator: Boolean read write;
Boolean Iterator { get; set; }
var Iterator: Boolean { get{} set{} }
Boolean Iterator { __get; __set; }
Property Iterator() As Boolean
LocalCount
Returns the number of locals this method has (locals defined in a var block before the begin)
property LocalCount: Int32 read;
Int32 LocalCount { get; }
var LocalCount: Int32 { get{} }
Int32 LocalCount { __get; }
ReadOnly Property LocalCount() As Int32
Locked
Get or set if this method has a locked modifier.
property Locked: Value read write;
Value Locked { get; set; }
var Locked: Value { get{} set{} }
Value Locked { __get; __set; }
Property Locked() As Value
Mangle
property Mangle: Boolean read write;
Boolean Mangle { get; set; }
var Mangle: Boolean { get{} set{} }
Boolean Mangle { __get; __set; }
Property Mangle() As Boolean
MethodBodyToStatementAnonymous
Returns a value containing the body of this method as a value
method MethodBodyToStatementAnonymous: Value
Value MethodBodyToStatementAnonymous()
func MethodBodyToStatementAnonymous() -> Value
Value MethodBodyToStatementAnonymous()
Function MethodBodyToStatementAnonymous() As Value
Optional
Get or set if this method has an optional modifier.
property Optional: Boolean read write;
Boolean Optional { get; set; }
var Optional: Boolean { get{} set{} }
Boolean Optional { __get; __set; }
Property Optional() As Boolean
RedirectedTo
property RedirectedTo: IMethod read write;
IMethod RedirectedTo { get; set; }
var RedirectedTo: IMethod { get{} set{} }
IMethod RedirectedTo { __get; __set; }
Property RedirectedTo() As IMethod
RemoveParameter (Int32)
Removes a parameter from this method
method RemoveParameter(no: Int32)
void RemoveParameter(Int32 no)
func RemoveParameter(_ no: Int32)
void RemoveParameter(Int32 no)
Sub RemoveParameter(no As Int32)
Parameters:
- no: index
RemoveParameter (IParameterDefinition)
Removes a parameter from this method
method RemoveParameter(parameter: IParameterDefinition)
void RemoveParameter(IParameterDefinition parameter)
func RemoveParameter(_ parameter: IParameterDefinition)
void RemoveParameter(IParameterDefinition parameter)
Sub RemoveParameter(parameter As IParameterDefinition)
Parameters:
- parameter: parameter to remove
RemoveRaises
Remove a raises from the raises list.
method RemoveRaises(no: Int32)
void RemoveRaises(Int32 no)
func RemoveRaises(_ no: Int32)
void RemoveRaises(Int32 no)
Sub RemoveRaises(no As Int32)
Parameters:
- no: index
ReplaceMethodBody
Replaces the method of the body with the statement passed here. The original statement will be placed at the location of the PlaceHolderStatement
method ReplaceMethodBody(Code: Statement)
void ReplaceMethodBody(Statement Code)
func ReplaceMethodBody(_ Code: Statement)
void ReplaceMethodBody(Statement Code)
Sub ReplaceMethodBody(Code As Statement)
Parameters:
- Code: new body
Required
property Required: Boolean read write;
Boolean Required { get; set; }
var Required: Boolean { get{} set{} }
Boolean Required { __get; __set; }
Property Required() As Boolean
Result
Returns the result of this method, or nil if it has none
property Result: IType read write;
IType Result { get; set; }
var Result: IType { get{} set{} }
IType Result { __get; __set; }
Property Result() As IType
SelectorName
selector name
property SelectorName: String read write;
String SelectorName { get; set; }
var SelectorName: String { get{} set{} }
String SelectorName { __get; __set; }
Property SelectorName() As String
SpecialName
Returns true if this method is a special name method, generally these are constructors and helper methods
property SpecialName: Boolean read write;
Boolean SpecialName { get; set; }
var SpecialName: Boolean { get{} set{} }
Boolean SpecialName { __get; __set; }
Property SpecialName() As Boolean
SurroundMethodBody
Surrounds the original method with the before and after calls.
method SurroundMethodBody(before: Statement; after: Statement; callwhen: SurroundMethod)
void SurroundMethodBody(Statement before, Statement after, SurroundMethod callwhen)
func SurroundMethodBody(_ before: Statement, _ after: Statement, _ callwhen: SurroundMethod)
void SurroundMethodBody(Statement before, Statement after, SurroundMethod callwhen)
Sub SurroundMethodBody(before As Statement, after As Statement, callwhen As SurroundMethod)
Parameters:
- before: code to insert before
- after: code to insert after the original body
- callwhen: When should both be called
Throws
property Throws: ThrowsState read write;
ThrowsState Throws { get; set; }
var Throws: ThrowsState { get{} set{} }
ThrowsState Throws { __get; __set; }
Property Throws() As ThrowsState
Virtual
The virtual mode of this method
property Virtual: VirtualMode read write;
VirtualMode Virtual { get; set; }
var Virtual: VirtualMode { get{} set{} }
VirtualMode Virtual { __get; __set; }
Property Virtual() As VirtualMode
Async
Get or set the async bit for this method
property Async: Boolean read write;
Boolean Async { get; set; }
var Async: Boolean { get{} set{} }
Boolean Async { __get; __set; }
Property Async() As Boolean
CompilerGenerated
property CompilerGenerated: Boolean read write;
Boolean CompilerGenerated { get; set; }
var CompilerGenerated: Boolean { get{} set{} }
Boolean CompilerGenerated { __get; __set; }
Property CompilerGenerated() As Boolean
Convenience
property Convenience: Boolean read write;
Boolean Convenience { get; set; }
var Convenience: Boolean { get{} set{} }
Boolean Convenience { __get; __set; }
Property Convenience() As Boolean
Empty
If true, this method has no body (empty; modifier)
property Empty: Boolean read write;
Boolean Empty { get; set; }
var Empty: Boolean { get{} set{} }
Boolean Empty { __get; __set; }
Property Empty() As Boolean
External
If true, this method has no body and is marked as "external", usually used for pinvoke.
property External: Boolean read write;
Boolean External { get; set; }
var External: Boolean { get{} set{} }
Boolean External { __get; __set; }
Property External() As Boolean
Final
If true, this method is final and cannot be overridden
property Final: Boolean read write;
Boolean Final { get; set; }
var Final: Boolean { get{} set{} }
Boolean Final { __get; __set; }
Property Final() As Boolean
HasLocked
Returns true if this method has a locked modifier.
property HasLocked: Boolean read;
Boolean HasLocked { get; }
var HasLocked: Boolean { get{} }
Boolean HasLocked { __get; }
ReadOnly Property HasLocked() As Boolean
Inline
Returns true if this mehod has an inline modifier.
property Inline: Boolean read write;
Boolean Inline { get; set; }
var Inline: Boolean { get{} set{} }
Boolean Inline { __get; __set; }
Property Inline() As Boolean
Iterator
If true, this method is an iterator method. This can only be set from the *Interface interface callbacks.
property Iterator: Boolean read write;
Boolean Iterator { get; set; }
var Iterator: Boolean { get{} set{} }
Boolean Iterator { __get; __set; }
Property Iterator() As Boolean
LocalCount
Returns the number of locals this method has (locals defined in a var block before the begin)
property LocalCount: Int32 read;
Int32 LocalCount { get; }
var LocalCount: Int32 { get{} }
Int32 LocalCount { __get; }
ReadOnly Property LocalCount() As Int32
Locked
Get or set if this method has a locked modifier.
property Locked: Value read write;
Value Locked { get; set; }
var Locked: Value { get{} set{} }
Value Locked { __get; __set; }
Property Locked() As Value
Mangle
property Mangle: Boolean read write;
Boolean Mangle { get; set; }
var Mangle: Boolean { get{} set{} }
Boolean Mangle { __get; __set; }
Property Mangle() As Boolean
Optional
Get or set if this method has an optional modifier.
property Optional: Boolean read write;
Boolean Optional { get; set; }
var Optional: Boolean { get{} set{} }
Boolean Optional { __get; __set; }
Property Optional() As Boolean
RedirectedTo
property RedirectedTo: IMethod read write;
IMethod RedirectedTo { get; set; }
var RedirectedTo: IMethod { get{} set{} }
IMethod RedirectedTo { __get; __set; }
Property RedirectedTo() As IMethod
Required
property Required: Boolean read write;
Boolean Required { get; set; }
var Required: Boolean { get{} set{} }
Boolean Required { __get; __set; }
Property Required() As Boolean
Result
Returns the result of this method, or nil if it has none
property Result: IType read write;
IType Result { get; set; }
var Result: IType { get{} set{} }
IType Result { __get; __set; }
Property Result() As IType
SelectorName
selector name
property SelectorName: String read write;
String SelectorName { get; set; }
var SelectorName: String { get{} set{} }
String SelectorName { __get; __set; }
Property SelectorName() As String
SpecialName
Returns true if this method is a special name method, generally these are constructors and helper methods
property SpecialName: Boolean read write;
Boolean SpecialName { get; set; }
var SpecialName: Boolean { get{} set{} }
Boolean SpecialName { __get; __set; }
Property SpecialName() As Boolean
Throws
property Throws: ThrowsState read write;
ThrowsState Throws { get; set; }
var Throws: ThrowsState { get{} set{} }
ThrowsState Throws { __get; __set; }
Property Throws() As ThrowsState
Virtual
The virtual mode of this method
property Virtual: VirtualMode read write;
VirtualMode Virtual { get; set; }
var Virtual: VirtualMode { get{} set{} }
VirtualMode Virtual { __get; __set; }
Property Virtual() As VirtualMode
AddGenericParameter
add a generic parameter to this method
method AddGenericParameter(aName: String): IGenericParameterTypeDefinition
IGenericParameterTypeDefinition AddGenericParameter(String aName)
func AddGenericParameter(_ aName: String) -> IGenericParameterTypeDefinition
IGenericParameterTypeDefinition AddGenericParameter(String aName)
Function AddGenericParameter(aName As String) As IGenericParameterTypeDefinition
Parameters:
- aName: name
Adds a local variable to the locals list
Parameters:
- name: name of the local
- type: type of the local
Adds a local variable to the locals list. This local will not have a name (unless set later) and will not show up in the locals list during debugging
Parameters:
- type: type of the local
AddParameter
Adds a new parameter to this method
method AddParameter(name: String; mode: ParameterModifier; type: IType): IParameterDefinition
IParameterDefinition AddParameter(String name, ParameterModifier mode, IType type)
func AddParameter(_ name: String, _ mode: ParameterModifier, _ type: IType) -> IParameterDefinition
IParameterDefinition AddParameter(String name, ParameterModifier mode, IType type)
Function AddParameter(name As String, mode As ParameterModifier, type As IType) As IParameterDefinition
Parameters:
- name: name of the new parameter
- mode: parameter direction
- type: type of the new parameter
AddRaises
Add a new raises for this method
method AddRaises(type: IType)
void AddRaises(IType type)
func AddRaises(_ type: IType)
void AddRaises(IType type)
Sub AddRaises(type As IType)
Parameters:
- type: the raises to add
Returns a local by name, or fails with an exception if it is not found. Used by the compiler
Parameters:
- aName: name of the local to look for
Returns a local by name, or fails with an exception if it is not found. Used by the compiler
Parameters:
- aName: name of the local to look for
- aType: type to expect
Returns a local by name, or fails with an exception if it is not found. Used by the compiler
Parameters:
- no: index
Returns a parameter by name, or fails with an exception if it is not found. Used by the compiler
Parameters:
- aName: name of the parameter to look for
Returns a parameter by name, or fails with an exception if it is not found. Used by the compiler
Parameters:
- aName: name of the parameter to look for
- aType: type of the parameter to expect
GetParameterArrayValue
Returns an array with all parameters in it
method GetParameterArrayValue: ArrayValue
ArrayValue GetParameterArrayValue()
func GetParameterArrayValue() -> ArrayValue
ArrayValue GetParameterArrayValue()
Function GetParameterArrayValue() As ArrayValue
GetResult
Returns a value object for the result of this method.
method GetResult: Value
Value GetResult()
func GetResult() -> Value
Value GetResult()
Function GetResult() As Value
Returns a value object for the result of this method.
Parameters:
- aType: type
MethodBodyToStatementAnonymous
Returns a value containing the body of this method as a value
method MethodBodyToStatementAnonymous: Value
Value MethodBodyToStatementAnonymous()
func MethodBodyToStatementAnonymous() -> Value
Value MethodBodyToStatementAnonymous()
Function MethodBodyToStatementAnonymous() As Value
RemoveParameter (Int32)
Removes a parameter from this method
method RemoveParameter(no: Int32)
void RemoveParameter(Int32 no)
func RemoveParameter(_ no: Int32)
void RemoveParameter(Int32 no)
Sub RemoveParameter(no As Int32)
Parameters:
- no: index
RemoveParameter (IParameterDefinition)
Removes a parameter from this method
method RemoveParameter(parameter: IParameterDefinition)
void RemoveParameter(IParameterDefinition parameter)
func RemoveParameter(_ parameter: IParameterDefinition)
void RemoveParameter(IParameterDefinition parameter)
Sub RemoveParameter(parameter As IParameterDefinition)
Parameters:
- parameter: parameter to remove
RemoveRaises
Remove a raises from the raises list.
method RemoveRaises(no: Int32)
void RemoveRaises(Int32 no)
func RemoveRaises(_ no: Int32)
void RemoveRaises(Int32 no)
Sub RemoveRaises(no As Int32)
Parameters:
- no: index
ReplaceMethodBody
Replaces the method of the body with the statement passed here. The original statement will be placed at the location of the PlaceHolderStatement
method ReplaceMethodBody(Code: Statement)
void ReplaceMethodBody(Statement Code)
func ReplaceMethodBody(_ Code: Statement)
void ReplaceMethodBody(Statement Code)
Sub ReplaceMethodBody(Code As Statement)
Parameters:
- Code: new body
SurroundMethodBody
Surrounds the original method with the before and after calls.
method SurroundMethodBody(before: Statement; after: Statement; callwhen: SurroundMethod)
void SurroundMethodBody(Statement before, Statement after, SurroundMethod callwhen)
func SurroundMethodBody(_ before: Statement, _ after: Statement, _ callwhen: SurroundMethod)
void SurroundMethodBody(Statement before, Statement after, SurroundMethod callwhen)
Sub SurroundMethodBody(before As Statement, after As Statement, callwhen As SurroundMethod)
Parameters:
- before: code to insert before
- after: code to insert after the original body
- callwhen: When should both be called