Repository navigation
Expand file tree
/
Copy pathBindingTest.html
More file actions
81 lines (73 loc) · 2.51 KB
/
Copy pathBindingTest.html
File metadata and controls
81 lines (73 loc) · 2.51 KB
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
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0 Transitional//EN">
<html>
<head>
<title>Binding Test</title>
</head>
<body>
<p>
Result of calling bound.repeat("hi ", 5) =
<script type="text/javascript">
var result = bound.repeat("hi ", 5);
document.write('"' + result + '"');
if(result == "hi hi hi hi hi ")
{
document.write(" SUCCESS");
}
else
{
document.write(" FAIL!");
}
</script>
</p>
<p>
Function delegate to c# method
<br />
<script type="text/javascript">
function myFunction(functionParam)
{
return functionParam();
}
document.write("echoMyProperty result: " + myFunction(bound.echoMyProperty));
</script>
</p>
<p>
Stress Test
<br />
<script type="text/javascript">
var stressTestCallCount = 1000;
for (var i = 1; i <= stressTestCallCount; i++) {
bound.repeat("hi ", 5);
}
document.write("Stress Test done with : " + stressTestCallCount + " call to bound.repeat(\"hi \", 5)");
</script>
</p>
Methods on bound object 'bound':<br />
<ul>
<script type="text/javascript">
for (var name in bound)
{
if (bound[name].constructor.name != 'Function') continue;
document.write("<li>" + name + "</li>");
}
</script>
</ul>
Properties in bound object 'bound':<br />
<ul>
<script type="text/javascript">
for (var name in bound)
{
if (bound[name].constructor.name == 'Function') continue;
document.write("<li>" + name + "</li>");
if (typeof bound[name] == "object" && bound[name] !== null)
{
for (var sub in bound[name])
{
var type = bound[name][sub].constructor.name == 'Function' ? "Function" : "Property";
document.write("<li>" + name + "." + sub + "(" + type + ")" + "</li>");
}
}
}
</script>
</ul>
</body>
</html>