1cdf0e10cSrcweir'*************************************************************************
2cdf0e10cSrcweir'
3*2f3df0e5SAndrew Rist'  Licensed to the Apache Software Foundation (ASF) under one
4*2f3df0e5SAndrew Rist'  or more contributor license agreements.  See the NOTICE file
5*2f3df0e5SAndrew Rist'  distributed with this work for additional information
6*2f3df0e5SAndrew Rist'  regarding copyright ownership.  The ASF licenses this file
7*2f3df0e5SAndrew Rist'  to you under the Apache License, Version 2.0 (the
8*2f3df0e5SAndrew Rist'  "License"); you may not use this file except in compliance
9*2f3df0e5SAndrew Rist'  with the License.  You may obtain a copy of the License at
10*2f3df0e5SAndrew Rist'
11*2f3df0e5SAndrew Rist'    http://www.apache.org/licenses/LICENSE-2.0
12*2f3df0e5SAndrew Rist'
13*2f3df0e5SAndrew Rist'  Unless required by applicable law or agreed to in writing,
14*2f3df0e5SAndrew Rist'  software distributed under the License is distributed on an
15*2f3df0e5SAndrew Rist'  "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
16*2f3df0e5SAndrew Rist'  KIND, either express or implied.  See the License for the
17*2f3df0e5SAndrew Rist'  specific language governing permissions and limitations
18*2f3df0e5SAndrew Rist'  under the License.
19cdf0e10cSrcweir'
20cdf0e10cSrcweir'*************************************************************************
21cdf0e10cSrcweir
22*2f3df0e5SAndrew Rist
23*2f3df0e5SAndrew Rist
24cdf0e10cSrcweirOption Explicit On
25cdf0e10cSrcweirOption Strict On
26cdf0e10cSrcweir
27cdf0e10cSrcweirimports System
28cdf0e10cSrcweirimports uno
29cdf0e10cSrcweirimports uno.util
30cdf0e10cSrcweirimports unoidl.com.sun.star.lang
31cdf0e10cSrcweirimports unoidl.com.sun.star.uno
32cdf0e10cSrcweirimports unoidl.com.sun.star.test.bridge
33cdf0e10cSrcweirimports System.Windows.Forms
34cdf0e10cSrcweirimports System.Diagnostics
35cdf0e10cSrcweirimports System.Reflection
36cdf0e10cSrcweir
37cdf0e10cSrcweir
38cdf0e10cSrcweirNamespace vb_testobj
39cdf0e10cSrcweirPublic Class VBBridgeTestObject
40cdf0e10cSrcweir    Inherits WeakBase
41cdf0e10cSrcweir    Implements XRecursiveCall, XBridgeTest2
42cdf0e10cSrcweir
43cdf0e10cSrcweir    Private m_xContext As XComponentContext
44cdf0e10cSrcweir
45cdf0e10cSrcweir    Public Sub New (xContext As XComponentContext)
46cdf0e10cSrcweir        MyBase.New
47cdf0e10cSrcweir        m_xContext = xContext
48cdf0e10cSrcweir    End Sub
49cdf0e10cSrcweir
50cdf0e10cSrcweir    Private m_bool As Boolean
51cdf0e10cSrcweir    Private m_char As Char
52cdf0e10cSrcweir    Private m_byte As Byte
53cdf0e10cSrcweir    Private m_short  As Short
54cdf0e10cSrcweir    Private m_ushort As UInt16
55cdf0e10cSrcweir    Private m_long As Integer
56cdf0e10cSrcweir    Private m_ulong As UInt32
57cdf0e10cSrcweir    Private m_hyper As Long
58cdf0e10cSrcweir    Private m_uhyper As UInt64
59cdf0e10cSrcweir    Private m_float As Single
60cdf0e10cSrcweir    Private m_double As Double
61cdf0e10cSrcweir    Private m_string As String
62cdf0e10cSrcweir    Private m_xInterface As Object
63cdf0e10cSrcweir    Private m_any As Any
64cdf0e10cSrcweir    Private m_testEnum As TestEnum = TestEnum.TEST
65cdf0e10cSrcweir    Private m_testElements() As TestElement = New TestElement(){}
66cdf0e10cSrcweir    Private m_testDataElements As TestDataElements = New TestDataElements
67cdf0e10cSrcweir    Private m_nLastCallId As Integer = 0
68cdf0e10cSrcweir    Private m_bFirstCall As Boolean = True
69cdf0e10cSrcweir    Private m_bSequenceOfCallTestPassed As Boolean = True
70cdf0e10cSrcweir
71cdf0e10cSrcweir    Private m_arBool() As Boolean
72cdf0e10cSrcweir    Private m_arChar() As Char
73cdf0e10cSrcweir    Private m_arByte() As Byte
74cdf0e10cSrcweir    Private m_arShort() As Short
75cdf0e10cSrcweir    Private m_arLong() As Integer
76cdf0e10cSrcweir    Private m_arHyper() As Long
77cdf0e10cSrcweir    Private m_arUShort() As UInt16
78cdf0e10cSrcweir    Private m_arULong() As UInt32
79cdf0e10cSrcweir    Private m_arUHyper() As UInt64
80cdf0e10cSrcweir    Private m_arString() As String
81cdf0e10cSrcweir    Private m_arFloat() As Single
82cdf0e10cSrcweir    Private m_arDouble() As Double
83cdf0e10cSrcweir    Private m_arEnum() As TestEnum
84cdf0e10cSrcweir    Private m_arObject() As Object
85cdf0e10cSrcweir    Private m_arLong2()() As Integer
86cdf0e10cSrcweir    Private m_arLong3()()() As Integer
87cdf0e10cSrcweir    Private m_arAny() As Any
88cdf0e10cSrcweir
89cdf0e10cSrcweir    Public Overridable Sub setValues( _
90cdf0e10cSrcweir        bBool As Boolean, aChar As Char, nByte As Byte, nShort As Short, _
91cdf0e10cSrcweir        nUShort As UInt16, nLong As Integer, nULong As UInt32, _
92cdf0e10cSrcweir        nHyper As Long, nUHyper As UInt64, fFloat As Single, _
93cdf0e10cSrcweir        fDouble As Double, testEnum As TestEnum, str As String, _
94cdf0e10cSrcweir        xInterface As Object, any As Any, testElements() As TestElement, _
95cdf0e10cSrcweir        testDataElements As TestDataElements) _
96cdf0e10cSrcweir        Implements XBridgeTest2.setValues
97cdf0e10cSrcweir#if DEBUG
98cdf0e10cSrcweir      '  Console.WriteLine( "##### " + GetType().FullName + ".setValues:" + any )
99cdf0e10cSrcweir#endif
100cdf0e10cSrcweir        m_bool             = bBool
101cdf0e10cSrcweir        m_char             = aChar
102cdf0e10cSrcweir        m_byte             = nByte
103cdf0e10cSrcweir        m_short            = nShort
104cdf0e10cSrcweir        m_ushort           = nUShort
105cdf0e10cSrcweir        m_long             = nLong
106cdf0e10cSrcweir        m_ulong            = nULong
107cdf0e10cSrcweir        m_hyper            = nHyper
108cdf0e10cSrcweir        m_uhyper           = nUHyper
109cdf0e10cSrcweir        m_float            = fFloat
110cdf0e10cSrcweir        m_double           = fDouble
111cdf0e10cSrcweir        m_testEnum         = testEnum
112cdf0e10cSrcweir        m_string           = str
113cdf0e10cSrcweir        m_xInterface       = xInterface
114cdf0e10cSrcweir        m_any              = any
115cdf0e10cSrcweir        m_testElements     = testElements
116cdf0e10cSrcweir        m_testDataElements = testDataElements
117cdf0e10cSrcweir    End Sub
118cdf0e10cSrcweir
119cdf0e10cSrcweir    Public Overridable Function setValues2( _
120cdf0e10cSrcweir        ByRef io_bool As Boolean, ByRef io_char As Char, _
121cdf0e10cSrcweir        ByRef io_byte As Byte, ByRef io_short As Short, _
122cdf0e10cSrcweir        ByRef io_ushort As UInt16, ByRef io_long As Integer, _
123cdf0e10cSrcweir        ByRef io_ulong As UInt32, ByRef io_hyper As Long, _
124cdf0e10cSrcweir        ByRef io_uhyper As UInt64, ByRef io_float As Single, _
125cdf0e10cSrcweir        ByRef io_double As Double, ByRef io_testEnum As TestEnum, _
126cdf0e10cSrcweir        ByRef io_string As String, ByRef io_xInterface As Object, _
127cdf0e10cSrcweir        ByRef io_any As Any, ByRef io_testElements() As TestElement, _
128cdf0e10cSrcweir        ByRef io_testDataElements As TestDataElements) As TestDataElements _
129cdf0e10cSrcweir        Implements XBridgeTest2.setValues2
130cdf0e10cSrcweir
131cdf0e10cSrcweir#if DEBUG
132cdf0e10cSrcweir        'Console.WriteLine( "##### " + GetType().FullName + ".setValues2:" + io_any )
133cdf0e10cSrcweir#endif
134cdf0e10cSrcweir
135cdf0e10cSrcweir        m_bool             = io_bool
136cdf0e10cSrcweir        m_char             = io_char
137cdf0e10cSrcweir        m_byte             = io_byte
138cdf0e10cSrcweir        m_short            = io_short
139cdf0e10cSrcweir        m_ushort           = io_ushort
140cdf0e10cSrcweir        m_long             = io_long
141cdf0e10cSrcweir        m_ulong            = io_ulong
142cdf0e10cSrcweir        m_hyper            = io_hyper
143cdf0e10cSrcweir        m_uhyper           = io_uhyper
144cdf0e10cSrcweir        m_float            = io_float
145cdf0e10cSrcweir        m_double           = io_double
146cdf0e10cSrcweir        m_testEnum         = io_testEnum
147cdf0e10cSrcweir        m_string           = io_string
148cdf0e10cSrcweir        m_xInterface       = io_xInterface
149cdf0e10cSrcweir        m_any              = io_any
150cdf0e10cSrcweir        m_testElements     = DirectCast(io_testElements.Clone(), TestElement())
151cdf0e10cSrcweir        m_testDataElements = io_testDataElements
152cdf0e10cSrcweir
153cdf0e10cSrcweir        Dim temp As TestElement = io_testElements(0)
154cdf0e10cSrcweir        io_testElements(0) = io_testElements(1)
155cdf0e10cSrcweir        io_testElements(1) = temp
156cdf0e10cSrcweir
157cdf0e10cSrcweir        Return m_testDataElements
158cdf0e10cSrcweir    End Function
159cdf0e10cSrcweir
160cdf0e10cSrcweir    Public Overridable Function  getValues( _
161cdf0e10cSrcweir        ByRef o_bool As Boolean, ByRef o_char As Char, _
162cdf0e10cSrcweir        ByRef o_byte As Byte, ByRef o_short As Short, _
163cdf0e10cSrcweir        ByRef o_ushort As UInt16, ByRef o_long As Integer, _
164cdf0e10cSrcweir        ByRef o_ulong As UInt32, ByRef o_hyper As Long, _
165cdf0e10cSrcweir        ByRef o_uhyper As UInt64, ByRef o_float As Single, _
166cdf0e10cSrcweir        ByRef o_double As Double, ByRef o_testEnum As TestEnum, _
167cdf0e10cSrcweir        ByRef o_string As String, ByRef o_xInterface As Object, _
168cdf0e10cSrcweir        ByRef o_any As Any, ByRef o_testElements() As TestElement, _
169cdf0e10cSrcweir        ByRef o_testDataElements As TestDataElements) As TestDataElements _
170cdf0e10cSrcweir        Implements XBridgeTest2.getValues
171cdf0e10cSrcweir#if DEBUG
172cdf0e10cSrcweir        'Console.WriteLine( "##### " + GetType().FullName + ".getValues" )
173cdf0e10cSrcweir#endif
174cdf0e10cSrcweir
175cdf0e10cSrcweir        o_bool             = m_bool
176cdf0e10cSrcweir        o_char             = m_char
177cdf0e10cSrcweir        o_byte             = m_byte
178cdf0e10cSrcweir        o_short            = m_short
179cdf0e10cSrcweir        o_ushort           = m_ushort
180cdf0e10cSrcweir        o_long             = m_long
181cdf0e10cSrcweir        o_ulong            = m_ulong
182cdf0e10cSrcweir        o_hyper            = m_hyper
183cdf0e10cSrcweir        o_uhyper           = m_uhyper
184cdf0e10cSrcweir        o_float            = m_float
185cdf0e10cSrcweir        o_double           = m_double
186cdf0e10cSrcweir        o_testEnum         = m_testEnum
187cdf0e10cSrcweir        o_string           = m_string
188cdf0e10cSrcweir        o_xInterface       = m_xInterface
189cdf0e10cSrcweir        o_any              = m_any
190cdf0e10cSrcweir        o_testElements     = m_testElements
191cdf0e10cSrcweir        o_testDataElements = m_testDataElements
192cdf0e10cSrcweir
193cdf0e10cSrcweir        Return m_testDataElements
194cdf0e10cSrcweir    End Function
195cdf0e10cSrcweir
196cdf0e10cSrcweir    ' Attributes ---------------------------------------------------------
197cdf0e10cSrcweir    Public Overridable Property Bool As Boolean _
198cdf0e10cSrcweir        Implements XBridgeTest2.Bool
199cdf0e10cSrcweir        Get
200cdf0e10cSrcweir            Return m_bool
201cdf0e10cSrcweir        End Get
202cdf0e10cSrcweir        Set (Value As Boolean)
203cdf0e10cSrcweir            m_bool = value
204cdf0e10cSrcweir        End Set
205cdf0e10cSrcweir    End Property
206cdf0e10cSrcweir
207cdf0e10cSrcweir    Public Overridable Property [Byte] As Byte _
208cdf0e10cSrcweir        Implements XBridgeTest2.Byte
209cdf0e10cSrcweir        Get
210cdf0e10cSrcweir            Return m_byte
211cdf0e10cSrcweir        End Get
212cdf0e10cSrcweir        Set (Value As Byte)
213cdf0e10cSrcweir            m_byte = value
214cdf0e10cSrcweir        End Set
215cdf0e10cSrcweir    End Property
216cdf0e10cSrcweir
217cdf0e10cSrcweir    Public Overridable Property [Char] As Char _
218cdf0e10cSrcweir        Implements XBridgeTest2.Char
219cdf0e10cSrcweir        Get
220cdf0e10cSrcweir            Return m_char
221cdf0e10cSrcweir        End Get
222cdf0e10cSrcweir        Set (Value As Char)
223cdf0e10cSrcweir            m_char = value
224cdf0e10cSrcweir        End Set
225cdf0e10cSrcweir    End Property
226cdf0e10cSrcweir
227cdf0e10cSrcweir    Public Overridable Property [Short] As Short _
228cdf0e10cSrcweir        Implements XBridgeTest2.Short
229cdf0e10cSrcweir        Get
230cdf0e10cSrcweir            Return m_short
231cdf0e10cSrcweir        End Get
232cdf0e10cSrcweir        Set (Value As Short)
233cdf0e10cSrcweir            m_short = value
234cdf0e10cSrcweir        End Set
235cdf0e10cSrcweir    End Property
236cdf0e10cSrcweir
237cdf0e10cSrcweir    Public Overridable Property [UShort] As UInt16 _
238cdf0e10cSrcweir        Implements XBridgeTest2.UShort
239cdf0e10cSrcweir        Get
240cdf0e10cSrcweir            Return m_ushort
241cdf0e10cSrcweir        End Get
242cdf0e10cSrcweir        Set (Value As UInt16)
243cdf0e10cSrcweir            m_ushort = value
244cdf0e10cSrcweir        End Set
245cdf0e10cSrcweir    End Property
246cdf0e10cSrcweir
247cdf0e10cSrcweir    Public Overridable Property [Long] As Integer _
248cdf0e10cSrcweir        Implements XBridgeTest2.Long
249cdf0e10cSrcweir        Get
250cdf0e10cSrcweir            Return m_long
251cdf0e10cSrcweir        End Get
252cdf0e10cSrcweir        Set (Value As Integer)
253cdf0e10cSrcweir            m_long = value
254cdf0e10cSrcweir        End Set
255cdf0e10cSrcweir    End Property
256cdf0e10cSrcweir
257cdf0e10cSrcweir    Public Overridable Property [ULong]() As UInt32 _
258cdf0e10cSrcweir        Implements XBridgeTest2.ULong
259cdf0e10cSrcweir        Get
260cdf0e10cSrcweir            Return m_ulong
261cdf0e10cSrcweir        End Get
262cdf0e10cSrcweir        Set (Value As UInt32)
263cdf0e10cSrcweir            m_ulong = value
264cdf0e10cSrcweir        End Set
265cdf0e10cSrcweir    End Property
266cdf0e10cSrcweir
267cdf0e10cSrcweir    Public Overridable Property Hyper As Long _
268cdf0e10cSrcweir        Implements XBridgeTest2.Hyper
269cdf0e10cSrcweir        Get
270cdf0e10cSrcweir            Return m_hyper
271cdf0e10cSrcweir        End Get
272cdf0e10cSrcweir        Set (Value As Long)
273cdf0e10cSrcweir            m_hyper = value
274cdf0e10cSrcweir        End Set
275cdf0e10cSrcweir    End Property
276cdf0e10cSrcweir
277cdf0e10cSrcweir    Public Overridable Property UHyper As UInt64 _
278cdf0e10cSrcweir        Implements XBridgeTest2.UHyper
279cdf0e10cSrcweir        Get
280cdf0e10cSrcweir            Return m_uhyper
281cdf0e10cSrcweir        End Get
282cdf0e10cSrcweir        Set (Value As UInt64)
283cdf0e10cSrcweir            m_uhyper = value
284cdf0e10cSrcweir        End Set
285cdf0e10cSrcweir    End Property
286cdf0e10cSrcweir
287cdf0e10cSrcweir    Public Overridable Property Float As Single _
288cdf0e10cSrcweir        Implements XBridgeTest2.Float
289cdf0e10cSrcweir        Get
290cdf0e10cSrcweir            Return m_float
291cdf0e10cSrcweir        End Get
292cdf0e10cSrcweir        Set (Value As Single)
293cdf0e10cSrcweir            m_float = value
294cdf0e10cSrcweir        End Set
295cdf0e10cSrcweir    End Property
296cdf0e10cSrcweir
297cdf0e10cSrcweir    Public Overridable Property [Double] As Double _
298cdf0e10cSrcweir        Implements XBridgeTest2.Double
299cdf0e10cSrcweir        Get
300cdf0e10cSrcweir            Return m_double
301cdf0e10cSrcweir        End Get
302cdf0e10cSrcweir        Set (Value As Double)
303cdf0e10cSrcweir            m_double = value
304cdf0e10cSrcweir        End Set
305cdf0e10cSrcweir    End Property
306cdf0e10cSrcweir
307cdf0e10cSrcweir    Public Overridable Property [Enum] As TestEnum _
308cdf0e10cSrcweir        Implements XBridgeTest2.Enum
309cdf0e10cSrcweir        Get
310cdf0e10cSrcweir            Return m_testEnum
311cdf0e10cSrcweir        End Get
312cdf0e10cSrcweir        Set (Value As TestEnum)
313cdf0e10cSrcweir            m_testEnum = value
314cdf0e10cSrcweir        End Set
315cdf0e10cSrcweir    End Property
316cdf0e10cSrcweir
317cdf0e10cSrcweir    Public Overridable Property [String] As String _
318cdf0e10cSrcweir        Implements XBridgeTest2.String
319cdf0e10cSrcweir        Get
320cdf0e10cSrcweir            Return m_string
321cdf0e10cSrcweir        End Get
322cdf0e10cSrcweir        Set (Value As String)
323cdf0e10cSrcweir            m_string = value
324cdf0e10cSrcweir        End Set
325cdf0e10cSrcweir    End Property
326cdf0e10cSrcweir
327cdf0e10cSrcweir    Public Overridable Property [Interface] As Object _
328cdf0e10cSrcweir        Implements XBridgeTest2.Interface
329cdf0e10cSrcweir        Get
330cdf0e10cSrcweir            Return m_xInterface
331cdf0e10cSrcweir        End Get
332cdf0e10cSrcweir        Set (Value As Object)
333cdf0e10cSrcweir            m_xInterface = value
334cdf0e10cSrcweir        End Set
335cdf0e10cSrcweir    End Property
336cdf0e10cSrcweir
337cdf0e10cSrcweir    Public Overridable Property  Any As uno.Any _
338cdf0e10cSrcweir        Implements XBridgeTest2.Any
339cdf0e10cSrcweir        Get
340cdf0e10cSrcweir#if DEBUG
341cdf0e10cSrcweir'            Console.WriteLine( "##### " + GetType().FullName + ".Any" )
342cdf0e10cSrcweir#endif
343cdf0e10cSrcweir            Return m_any
344cdf0e10cSrcweir        End Get
345cdf0e10cSrcweir        Set (Value As Any)
346cdf0e10cSrcweir#if DEBUG
347cdf0e10cSrcweir            'Console.WriteLine( "##### " + GetType().FullName + ".Any:" + value )
348cdf0e10cSrcweir#endif
349cdf0e10cSrcweir            m_any = value
350cdf0e10cSrcweir        End Set
351cdf0e10cSrcweir    End Property
352cdf0e10cSrcweir
353cdf0e10cSrcweir    Public Overridable Property Sequence As TestElement() _
354cdf0e10cSrcweir        Implements XBridgeTest2.Sequence
355cdf0e10cSrcweir        Get
356cdf0e10cSrcweir            Return m_testElements
357cdf0e10cSrcweir        End Get
358cdf0e10cSrcweir        Set (Value() As TestElement)
359cdf0e10cSrcweir            m_testElements = value
360cdf0e10cSrcweir        End Set
361cdf0e10cSrcweir    End Property
362cdf0e10cSrcweir
363cdf0e10cSrcweir    Public Overridable Property Struct As TestDataElements _
364cdf0e10cSrcweir        Implements XBridgeTest2.Struct
365cdf0e10cSrcweir        Get
366cdf0e10cSrcweir            Return m_testDataElements
367cdf0e10cSrcweir        End Get
368cdf0e10cSrcweir        Set (Value As TestDataElements)
369cdf0e10cSrcweir            m_testDataElements = value
370cdf0e10cSrcweir        End Set
371cdf0e10cSrcweir    End Property
372cdf0e10cSrcweir
373cdf0e10cSrcweir    Public Overridable Function transportAny(value As Any) As Any _
374cdf0e10cSrcweir        Implements XBridgeTest2.transportAny
375cdf0e10cSrcweir        Return value
376cdf0e10cSrcweir    End Function
377cdf0e10cSrcweir
378cdf0e10cSrcweir    Public Overridable Sub [call](nCallId As Integer, nWaitMUSEC As Integer) _
379cdf0e10cSrcweir        Implements XBridgeTest2.call
380cdf0e10cSrcweir
381cdf0e10cSrcweir        Threading.Thread.Sleep(CType(nWaitMUSEC / 10000, Integer))
382cdf0e10cSrcweir        If m_bFirstCall = True
383cdf0e10cSrcweir            m_bFirstCall = False
384cdf0e10cSrcweir        Else
385cdf0e10cSrcweir            m_bSequenceOfCallTestPassed = m_bSequenceOfCallTestPassed And (nCallId > m_nLastCallId)
386cdf0e10cSrcweir        End If
387cdf0e10cSrcweir        m_nLastCallId = nCallId
388cdf0e10cSrcweir    End Sub
389cdf0e10cSrcweir
390cdf0e10cSrcweir    Public Overridable Sub callOneway(nCallId As Integer, nWaitMUSEC As Integer) _
391cdf0e10cSrcweir        Implements XBridgeTest2.callOneway
392cdf0e10cSrcweir
393cdf0e10cSrcweir        Threading.Thread.Sleep(CType(nWaitMUSEC / 10000, Integer))
394cdf0e10cSrcweir        m_bSequenceOfCallTestPassed = m_bSequenceOfCallTestPassed And (nCallId > m_nLastCallId)
395cdf0e10cSrcweir        m_nLastCallId = nCallId
396cdf0e10cSrcweir    End Sub
397cdf0e10cSrcweir
398cdf0e10cSrcweir    Public Overridable Function sequenceOfCallTestPassed() As Boolean _
399cdf0e10cSrcweir        Implements XBridgeTest2.sequenceOfCallTestPassed
400cdf0e10cSrcweir        Return m_bSequenceOfCallTestPassed
401cdf0e10cSrcweir    End Function
402cdf0e10cSrcweir
403cdf0e10cSrcweir    Public Overridable Sub callRecursivly(xCall As  XRecursiveCall, nToCall As Integer) _
404cdf0e10cSrcweir        Implements XRecursiveCall.callRecursivly
405cdf0e10cSrcweir        SyncLock (Me)
406cdf0e10cSrcweir            If nToCall <> 0
407cdf0e10cSrcweir                nToCall = nToCall - 1
408cdf0e10cSrcweir                xCall.callRecursivly(Me , nToCall)
409cdf0e10cSrcweir            End If
410cdf0e10cSrcweir        End SyncLock
411cdf0e10cSrcweir    End Sub
412cdf0e10cSrcweir
413cdf0e10cSrcweir    Public Overridable Sub startRecursiveCall(xCall As  XRecursiveCall, nToCall As Integer) _
414cdf0e10cSrcweir        Implements XBridgeTest2.startRecursiveCall
415cdf0e10cSrcweir        SyncLock (Me)
416cdf0e10cSrcweir            If nToCall <> 0
417cdf0e10cSrcweir                nToCall = nToCall - 1
418cdf0e10cSrcweir                xCall.callRecursivly(Me , nToCall )
419cdf0e10cSrcweir            End If
420cdf0e10cSrcweir        End SyncLock
421cdf0e10cSrcweir    End Sub
422cdf0e10cSrcweir
423cdf0e10cSrcweir    ' XBridgeTest
424cdf0e10cSrcweir    Public Overridable Function raiseException( _
425cdf0e10cSrcweir        nArgumentPos As Short, rMsg As String, xContext As Object) As TestDataElements _
426cdf0e10cSrcweir        Implements XBridgeTest2.raiseException
427cdf0e10cSrcweir        Throw New IllegalArgumentException(rMsg, xContext, nArgumentPos)
428cdf0e10cSrcweir    End Function
429cdf0e10cSrcweir
430cdf0e10cSrcweir    Public Overridable Sub raiseRuntimeExceptionOneway(rMsg As  String , xContext As Object) _
431cdf0e10cSrcweir        Implements XBridgeTest2.raiseRuntimeExceptionOneway
432cdf0e10cSrcweir        Throw New RuntimeException(rMsg, xContext)
433cdf0e10cSrcweir    End Sub
434cdf0e10cSrcweir
435cdf0e10cSrcweir    Public Overridable Property RuntimeException As Integer _
436cdf0e10cSrcweir        Implements XBridgeTest2.RuntimeException
437cdf0e10cSrcweir        Get
438cdf0e10cSrcweir            Throw New RuntimeException(m_string, m_xInterface)
439cdf0e10cSrcweir        End Get
440cdf0e10cSrcweir        Set (Value As Integer)
441cdf0e10cSrcweir            Throw New RuntimeException(m_string, m_xInterface)
442cdf0e10cSrcweir        End Set
443cdf0e10cSrcweir    End Property
444cdf0e10cSrcweir
445cdf0e10cSrcweir    ' XBridgeTest2
446cdf0e10cSrcweir    Public Overridable Function setDim2(val()() As Integer) As Integer()() _
447cdf0e10cSrcweir        Implements XBridgeTest2.setDim2
448cdf0e10cSrcweir        m_arLong2 = val
449cdf0e10cSrcweir        Return val
450cdf0e10cSrcweir    End Function
451cdf0e10cSrcweir
452cdf0e10cSrcweir    Public Overridable Function setDim3(val()()() As Integer) As Integer()()() _
453cdf0e10cSrcweir        Implements XBridgeTest2.setDim3
454cdf0e10cSrcweir        m_arLong3 = val
455cdf0e10cSrcweir        Return val
456cdf0e10cSrcweir    End Function
457cdf0e10cSrcweir
458cdf0e10cSrcweir    Public Overridable Function setSequenceAny(val() As Any) As Any() _
459cdf0e10cSrcweir        Implements XBridgeTest2.setSequenceAny
460cdf0e10cSrcweir        m_arAny = val
461cdf0e10cSrcweir        Return val
462cdf0e10cSrcweir    End Function
463cdf0e10cSrcweir
464cdf0e10cSrcweir    Public Overridable Function setSequenceBool(val() As Boolean) As Boolean() _
465cdf0e10cSrcweir        Implements XBridgeTest2.setSequenceBool
466cdf0e10cSrcweir        m_arBool = val
467cdf0e10cSrcweir        Return val
468cdf0e10cSrcweir    End Function
469cdf0e10cSrcweir
470cdf0e10cSrcweir    Public Overridable Function setSequenceByte(val() As Byte) As Byte() _
471cdf0e10cSrcweir        Implements XBridgeTest2.setSequenceByte
472cdf0e10cSrcweir        m_arByte = val
473cdf0e10cSrcweir        Return val
474cdf0e10cSrcweir    End Function
475cdf0e10cSrcweir
476cdf0e10cSrcweir    Public Overridable Function setSequenceChar(val() As Char) As Char() _
477cdf0e10cSrcweir        Implements XBridgeTest2.setSequenceChar
478cdf0e10cSrcweir        m_arChar = val
479cdf0e10cSrcweir        Return val
480cdf0e10cSrcweir    End Function
481cdf0e10cSrcweir
482cdf0e10cSrcweir    Public Overridable Function setSequenceShort(val() As Short) As Short() _
483cdf0e10cSrcweir        Implements XBridgeTest2.setSequenceShort
484cdf0e10cSrcweir        m_arShort = val
485cdf0e10cSrcweir        Return val
486cdf0e10cSrcweir    End Function
487cdf0e10cSrcweir
488cdf0e10cSrcweir    Public Overridable Function setSequenceLong(val() As Integer) As Integer() _
489cdf0e10cSrcweir        Implements XBridgeTest2.setSequenceLong
490cdf0e10cSrcweir
491cdf0e10cSrcweir        m_arLong = val
492cdf0e10cSrcweir        Return val
493cdf0e10cSrcweir    End Function
494cdf0e10cSrcweir
495cdf0e10cSrcweir    Public Overridable Function setSequenceHyper(val() As Long) As Long() _
496cdf0e10cSrcweir        Implements XBridgeTest2.setSequenceHyper
497cdf0e10cSrcweir        m_arHyper = val
498cdf0e10cSrcweir        Return val
499cdf0e10cSrcweir    End Function
500cdf0e10cSrcweir
501cdf0e10cSrcweir    Public Overridable Function setSequenceFloat(val() As Single) As Single() _
502cdf0e10cSrcweir        Implements XBridgeTest2.setSequenceFloat
503cdf0e10cSrcweir        m_arFloat = val
504cdf0e10cSrcweir        Return val
505cdf0e10cSrcweir    End Function
506cdf0e10cSrcweir
507cdf0e10cSrcweir    Public Overridable Function setSequenceDouble(val() As Double) As Double() _
508cdf0e10cSrcweir        Implements XBridgeTest2.setSequenceDouble
509cdf0e10cSrcweir        m_arDouble = val
510cdf0e10cSrcweir        Return val
511cdf0e10cSrcweir    End Function
512cdf0e10cSrcweir
513cdf0e10cSrcweir    Public Overridable Function setSequenceEnum(val() As TestEnum) As TestEnum() _
514cdf0e10cSrcweir        Implements XBridgeTest2.setSequenceEnum
515cdf0e10cSrcweir        m_arEnum = val
516cdf0e10cSrcweir        Return val
517cdf0e10cSrcweir    End Function
518cdf0e10cSrcweir
519cdf0e10cSrcweir    Public Overridable Function setSequenceUShort(val() As UInt16) As UInt16() _
520cdf0e10cSrcweir        Implements XBridgeTest2.setSequenceUShort
521cdf0e10cSrcweir        m_arUShort = val
522cdf0e10cSrcweir        Return val
523cdf0e10cSrcweir    End Function
524cdf0e10cSrcweir
525cdf0e10cSrcweir    Public Overridable Function setSequenceULong(val() As  UInt32) As  UInt32() _
526cdf0e10cSrcweir        Implements XBridgeTest2.setSequenceULong
527cdf0e10cSrcweir        m_arULong = val
528cdf0e10cSrcweir        Return  val
529cdf0e10cSrcweir    End Function
530cdf0e10cSrcweir
531cdf0e10cSrcweir    Public Overridable Function setSequenceUHyper(val() As UInt64) As UInt64() _
532cdf0e10cSrcweir        Implements XBridgeTest2.setSequenceUHyper
533cdf0e10cSrcweir        m_arUHyper = val
534cdf0e10cSrcweir        Return val
535cdf0e10cSrcweir    End Function
536cdf0e10cSrcweir
537cdf0e10cSrcweir    Public Overridable Function setSequenceXInterface(val() As Object ) As Object() _
538cdf0e10cSrcweir        Implements XBridgeTest2.setSequenceXInterface
539cdf0e10cSrcweir        m_arObject = val
540cdf0e10cSrcweir        Return val
541cdf0e10cSrcweir    End Function
542cdf0e10cSrcweir
543cdf0e10cSrcweir    Public Overridable Function setSequenceString(val() As String) As String() _
544cdf0e10cSrcweir        Implements XBridgeTest2.setSequenceString
545cdf0e10cSrcweir        m_arString = val
546cdf0e10cSrcweir        Return val
547cdf0e10cSrcweir    End Function
548cdf0e10cSrcweir
549cdf0e10cSrcweir    Public Overridable Function setSequenceStruct(val() As TestElement) As TestElement() _
550cdf0e10cSrcweir        Implements XBridgeTest2.setSequenceStruct
551cdf0e10cSrcweir        m_testElements = val
552cdf0e10cSrcweir        Return val
553cdf0e10cSrcweir    End Function
554cdf0e10cSrcweir
555cdf0e10cSrcweir    Public Overridable Sub setSequencesInOut( _
556cdf0e10cSrcweir        ByRef aSeqBoolean() As Boolean, ByRef aSeqChar() As Char, _
557cdf0e10cSrcweir        ByRef aSeqByte() As Byte, ByRef aSeqShort() As Short, _
558cdf0e10cSrcweir        ByRef aSeqUShort() As UInt16, ByRef aSeqLong() As Integer, _
559cdf0e10cSrcweir        ByRef aSeqULong() As  UInt32, ByRef aSeqHyper() As Long, _
560cdf0e10cSrcweir        ByRef aSeqUHyper() As UInt64, ByRef aSeqFloat() As Single, _
561cdf0e10cSrcweir        ByRef aSeqDouble() As Double, ByRef aSeqTestEnum() As TestEnum, _
562cdf0e10cSrcweir        ByRef aSeqString() As String, ByRef aSeqXInterface() As Object, _
563cdf0e10cSrcweir        ByRef aSeqAny() As Any, ByRef aSeqDim2()() As Integer, _
564cdf0e10cSrcweir        ByRef aSeqDim3()()() As Integer) _
565cdf0e10cSrcweir        Implements XBridgeTest2.setSequencesInOut
566cdf0e10cSrcweir
567cdf0e10cSrcweir        m_arBool = aSeqBoolean
568cdf0e10cSrcweir        m_arChar = aSeqChar
569cdf0e10cSrcweir        m_arByte = aSeqByte
570cdf0e10cSrcweir        m_arShort = aSeqShort
571cdf0e10cSrcweir        m_arUShort = aSeqUShort
572cdf0e10cSrcweir        m_arLong = aSeqLong
573cdf0e10cSrcweir        m_arULong = aSeqULong
574cdf0e10cSrcweir        m_arHyper  = aSeqHyper
575cdf0e10cSrcweir        m_arUHyper = aSeqUHyper
576cdf0e10cSrcweir        m_arFloat = aSeqFloat
577cdf0e10cSrcweir        m_arDouble = aSeqDouble
578cdf0e10cSrcweir        m_arEnum = aSeqTestEnum
579cdf0e10cSrcweir        m_arString = aSeqString
580cdf0e10cSrcweir        m_arObject = aSeqXInterface
581cdf0e10cSrcweir        m_arAny = aSeqAny
582cdf0e10cSrcweir        m_arLong2 = aSeqDim2
583cdf0e10cSrcweir        m_arLong3 = aSeqDim3
584cdf0e10cSrcweir    End Sub
585cdf0e10cSrcweir
586cdf0e10cSrcweir    Public Overridable Sub setSequencesOut( _
587cdf0e10cSrcweir        ByRef aSeqBoolean() As Boolean, ByRef aSeqChar() As Char, _
588cdf0e10cSrcweir        ByRef aSeqByte() As Byte, ByRef aSeqShort() As Short, _
589cdf0e10cSrcweir        ByRef aSeqUShort() As UInt16, ByRef aSeqLong() As Integer, _
590cdf0e10cSrcweir        ByRef aSeqULong() As  UInt32, ByRef aSeqHyper() As Long, _
591cdf0e10cSrcweir        ByRef aSeqUHyper() As UInt64, ByRef  aSeqFloat() As Single, _
592cdf0e10cSrcweir        ByRef aSeqDouble() As Double, ByRef aSeqTestEnum() As TestEnum, _
593cdf0e10cSrcweir        ByRef aSeqString() As String, ByRef aSeqXInterface() As Object, _
594cdf0e10cSrcweir        ByRef aSeqAny() As Any, ByRef aSeqDim2()() As Integer, _
595cdf0e10cSrcweir        ByRef aSeqDim3()()() As Integer) _
596cdf0e10cSrcweir        Implements XBridgeTest2.setSequencesOut
597cdf0e10cSrcweir
598cdf0e10cSrcweir        aSeqBoolean = m_arBool
599cdf0e10cSrcweir        aSeqChar = m_arChar
600cdf0e10cSrcweir        aSeqByte = m_arByte
601cdf0e10cSrcweir        aSeqShort = m_arShort
602cdf0e10cSrcweir        aSeqUShort = m_arUShort
603cdf0e10cSrcweir        aSeqLong = m_arLong
604cdf0e10cSrcweir        aSeqULong = m_arULong
605cdf0e10cSrcweir        aSeqHyper = m_arHyper
606cdf0e10cSrcweir        aSeqUHyper = m_arUHyper
607cdf0e10cSrcweir        aSeqFloat = m_arFloat
608cdf0e10cSrcweir        aSeqDouble = m_arDouble
609cdf0e10cSrcweir        aSeqTestEnum = m_arEnum
610cdf0e10cSrcweir        aSeqString = m_arString
611cdf0e10cSrcweir        aSeqXInterface = m_arObject
612cdf0e10cSrcweir        aSeqAny = m_arAny
613cdf0e10cSrcweir        aSeqDim2 = m_arLong2
614cdf0e10cSrcweir        aSeqDim3 = m_arLong3
615cdf0e10cSrcweir
616cdf0e10cSrcweir    End Sub
617cdf0e10cSrcweir
618cdf0e10cSrcweirEnd Class
619cdf0e10cSrcweir
620cdf0e10cSrcweirEnd Namespace
621