Initial data commit
This commit is contained in:
parent
72d218235f
commit
f23f22d71c
199087 changed files with 3378941 additions and 0 deletions
44
Task/Delegates/OxygenBasic/delegates.basic
Normal file
44
Task/Delegates/OxygenBasic/delegates.basic
Normal file
|
|
@ -0,0 +1,44 @@
|
|||
class DelegateA 'not implmenting thing()
|
||||
'==============
|
||||
'
|
||||
string message
|
||||
|
||||
end class
|
||||
|
||||
class DelegateB 'implementing thing()
|
||||
'==============
|
||||
'
|
||||
string message
|
||||
|
||||
method thing() as string
|
||||
return message
|
||||
end method
|
||||
'
|
||||
end class
|
||||
|
||||
|
||||
Class Delegator
|
||||
'==============
|
||||
'
|
||||
has DelegateA dgA
|
||||
has DelegateB dgB
|
||||
'
|
||||
method operation() as DelegateB
|
||||
dgB.message="Delegate Implementation"
|
||||
return @dgB
|
||||
end method
|
||||
|
||||
method thing() as string
|
||||
return "not using Delegate"
|
||||
end method
|
||||
'
|
||||
end class
|
||||
|
||||
'====
|
||||
'TEST
|
||||
'====
|
||||
|
||||
Delegator dgr
|
||||
let dg=dgr.operation
|
||||
print dgr.thing 'result "not using Delegate"
|
||||
print dg.thing 'result "Delegate Implementation"
|
||||
Loading…
Add table
Add a link
Reference in a new issue