FazBrowse GitHub Viewer
|
Trending
|
URL:
|
Home
Tools:
[Download Repo ZIP]
[View Raw Code]
[Original HTTPS Page]
ClearScript/ClearScriptTest/VBScript/General.vbs at master · ClearFoundry/ClearScript · GitHub
Uh oh!
There was an error while loading.
Please reload this page
.
ClearFoundry
/
ClearScript
Public
Notifications
You must be signed in to change notification settings
Fork
167
Star
2k
Code
Issues
18
Pull requests
6
Discussions
Actions
Security and quality
0
Insights
Additional navigation options
Code
Issues
Pull requests
Discussions
Actions
Security and quality
Insights
Expand file tree
Breadcrumbs
ClearScript
/
ClearScriptTest
/
VBScript
/
General.vbs
Copy path
More file actions
More file actions
Latest commit
History
History
History
65 lines (54 loc) · 2.32 KB
Breadcrumbs
ClearScript
/
ClearScriptTest
/
VBScript
/
General.vbs
Copy path
File metadata and controls
65 lines (54 loc) · 2.32 KB
Raw
Copy raw file
Download raw file
Open symbols panel
Edit and raw actions
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
' Copyright (c) Microsoft Corporation. All rights reserved
.
' Licensed under the MIT license.
set
System
=
clr.System
set
TestObjectT
=
host.type(
"Microsoft.ClearScript.Test.GeneralTestObject"
,
"ClearScriptTest"
)
set
tlist
=
host.newObj(System.Collections.Generic.List(TestObjectT))
call
tlist.Add(host.newObj(TestObjectT,
"Eóin"
,
20
))
call
tlist.Add(host.newObj(TestObjectT,
"Shane"
,
16
))
call
tlist.Add(host.newObj(TestObjectT,
"Cillian"
,
8
))
call
tlist.Add(host.newObj(TestObjectT,
"Sasha"
,
6
))
call
tlist.Add(host.newObj(TestObjectT,
"Brian"
,
3
))
class
VBTestObject
public
name
public
age
end
class
function
createTestObject(name,
age)
dim
testObject
set
testObject
=
new
VBTestObject
testObject.name
=
name
testObject.age
=
age
set
createTestObject
=
testObject
end
function
set
olist
=
host.newObj(System.Collections.Generic.List(System.Object))
call
olist.Add(createTestObject(
"Brian"
,
3
))
call
olist.Add(createTestObject(
"Sasha"
,
6
))
call
olist.Add(createTestObject(
"Cillian"
,
8
))
call
olist.Add(createTestObject(
"Shane"
,
16
))
call
olist.Add(createTestObject(
"Eóin"
,
20
))
set
dict
=
host.newObj(System.Collections.Generic.Dictionary(System.String,
System.String))
call
dict.Add(
"foo"
,
"bar"
)
call
dict.Add(
"baz"
,
"qux"
)
set
value
=
host.newVar(System.String)
result
=
dict.TryGetValue(
"foo"
,
value.out)
set
expando
=
host.newObj(System.Dynamic.ExpandoObject)
set
expandoCollection
=
host.cast(System.Collections.Generic.ICollection(System.Collections.Generic.KeyValuePair(System.String,
System.Object)),
expando)
set
onEventRef
=
GetRef(
"onEvent"
)
sub
onEvent(s,
e)
call
System.Console.WriteLine(
"Property changed: {0}; new value: {1}"
,
e.PropertyName,
eval(
"s."
+
e.PropertyName))
end
sub
set
onStaticEventRef
=
GetRef(
"onStaticEvent"
)
sub
onStaticEvent(s,
e)
call
System.Console.WriteLine(
"Property changed: {0}; new value: {1} (static event)"
,
e.PropertyName,
e.PropertyValue)
end
sub
set
eventCookie
=
tlist.Item(
0
).Change.connect(onEventRef)
set
staticEventCookie
=
TestObjectT.StaticChange.connect(onStaticEventRef)
tlist.Item(
0
).Name
=
"Jerry"
tlist.Item(
1
).Name
=
"Ellis"
tlist.Item(
0
).Name
=
"Eóin"
tlist.Item(
1
).Name
=
"Shane"
call
eventCookie.disconnect()
call
staticEventCookie.disconnect()
tlist.Item(
0
).Name
=
"Jerry"
tlist.Item(
1
).Name
=
"Ellis"
tlist.Item(
0
).Name
=
"Eóin"
tlist.Item(
1
).Name
=
"Shane"
Back
|
FazBrowse Home
|
New Git URL