Copied remotely
[mono.git] / mcs / class / Microsoft.VisualBasic / Test / standalone / 12308.vb
1   '\r
2   ' Copyright (c) 2002-2003 Mainsoft Corporation.\r
3   '\r
4   ' Permission is hereby granted, free of charge, to any person obtaining a\r
5   ' copy of this software and associated documentation files (the "Software"),\r
6   ' to deal in the Software without restriction, including without limitation\r
7   ' the rights to use, copy, modify, merge, publish, distribute, sublicense,\r
8   ' and/or sell copies of the Software, and to permit persons to whom the\r
9   ' Software is furnished to do so, subject to the following conditions:\r
10   ' \r
11   ' The above copyright notice and this permission notice shall be included in\r
12   ' all copies or substantial portions of the Software.\r
13   ' \r
14   ' THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR\r
15   ' IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,\r
16   ' FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE\r
17   ' AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER\r
18   ' LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING\r
19   ' FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER\r
20   ' DEALINGS IN THE SOFTWARE.\r
21   '
22
23
24 Imports Microsoft.VisualBasic\r
25 Public Class TestClass\r
26     Public Function Test() As String\r
27         Dim oCa As New Ca()\r
28         Dim str1 As String\r
29 \r
30         '  Set a property.\r
31         CallByName(oCa, "prop", CallType.Set, "new val")\r
32         '  Retrieve the value of a property.\r
33         CallByName(oCa, "prop", CallType.Get)\r
34 \r
35         str1 = CallByName(oCa, "foo", CallType.Method, "a1", "a2")\r
36 \r
37         Return str1\r
38     End Function\r
39 End Class\r
40 Public Class Ca\r
41     Private m_value As String\r
42     Public Property prop() As String\r
43         Get\r
44             Return m_value\r
45         End Get\r
46         Set(ByVal Value As String)\r
47             m_value = Value\r
48         End Set\r
49     End Property\r
50     Public Function foo(ByVal var1 As String, ByVal var2 As String) As String\r
51         Return "foo" & m_value & var1 & var2\r
52     End Function\r
53 End Class