-
Notifications
You must be signed in to change notification settings - Fork 45
/
Copy pathBindingTestClass.cs
77 lines (65 loc) · 1.91 KB
/
BindingTestClass.cs
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
using System;
using System.Collections.Generic;
using System.Threading.Tasks;
namespace Xilium.CefGlue.Demo.Avalonia
{
internal class BindingTestClass
{
public class InnerObject
{
public string Name;
public int Value;
}
public DateTime GetDate()
{
return DateTime.Now;
}
public string GetString()
{
return "Hello World!";
}
public int GetInt()
{
return 10;
}
public double GetDouble()
{
return 10.45;
}
public bool GetBool()
{
return true;
}
public string[] GetList()
{
return new[] { "item 1", "item 2", "item 3" };
}
public IDictionary<string, object> GetDictionary()
{
return new Dictionary<string, object>
{
{ "Name", "This is a dictionary" },
{ "Value", 10.5 }
};
}
public object GetObject()
{
return new InnerObject { Name = "This is an object", Value = 5 };
}
public object GetObjectWithParams(int anIntParam, string aStringParam, InnerObject anObjectParam, int[] intArrayParam)
{
return new InnerObject { Name = "This is an object", Value = 5 };
}
public async Task<bool> AsyncGetObjectWithParams(string aStringParam)
{
Console.WriteLine(DateTime.Now + ": Called " + nameof(AsyncGetObjectWithParams));
await Task.Delay(5000).ConfigureAwait(false);
Console.WriteLine(DateTime.Now + ": Continuing " + nameof(AsyncGetObjectWithParams));
return true;
}
public string[] GetObjectWithParamArray(int anIntParam, params string[] paramWithParamArray)
{
return paramWithParamArray;
}
}
}