Changeset 342
- Timestamp:
- Sep 29, 2007, 12:44:41 PM (17 years ago)
- Location:
- trunk
- Files:
-
- 3 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/TestCase/SimpleTestCase/DelegateTest.ab
r340 r342 5 5 Delegate Sub Callback3( a As Long ) 6 6 Delegate Sub Callback4( a As String ) 7 Delegate Function Callback7( ) As Long7 Delegate Function Callback7( str As String ) As String 8 8 9 9 … … 59 59 End Sub 60 60 61 Function Proc7() As String62 Return "Proc7 result "61 Static Function Proc7( str As String ) As String 62 Return "Proc7 result[" + str + "]" 63 63 End Function 64 64 End Class … … 79 79 80 80 UnitTest( "Delegate1", testObj.CheckFlags() ) 81 /* 81 82 82 Dim dg7 = New Callback7( AddressOf(TestClass.Proc7) ) 83 UnitTest( "Delegate2", dg7( ) = "Proc7 result" )84 */ 83 UnitTest( "Delegate2", dg7( "test value" ) = "Proc7 result[test value]" ) 84 85 85 End Sub 86 86 -
trunk/bin/SubOperation/templates/delegate_class.tab
r340 r342 15 15 For i = 0 To ELM(simpleDelegates.Count) 16 16 Dim sd = simpleDelegates[i] 17 #result# __delegate_dynamicmethod_call(sd.methodPtr, sd.object, #params#) 17 If sd.hasThisPtr Then 18 #result# __delegate_dynamicmethod_call(sd.methodPtr, sd.object, #params#) 19 Else 20 #result# __delegate_staticmethod_call(sd.methodPtr, #params#) 21 End If 18 22 Next 19 23 'End Sub … … 30 34 End Function 31 35 32 Static Function _CreateD elegate( object As Object, methodPtr As VoidPtr ) As #name#36 Static Function _CreateDynamicDelegate( object As Object, methodPtr As VoidPtr ) As #name# 33 37 Dim dg = New #name# 34 38 dg.simpleDelegates.Add( New System._SimpleDelegate( object, methodPtr ) ) 35 39 Return dg 36 40 End Function 41 42 Static Function _CreateStaticDelegate( methodPtr As VoidPtr ) As #name# 43 Dim dg = New #name# 44 dg.simpleDelegates.Add( New System._SimpleDelegate( methodPtr ) ) 45 Return dg 46 End Function 37 47 End Class 38 48 #namespace_end#
Note:
See TracChangeset
for help on using the changeset viewer.