summaryrefslogtreecommitdiff
path: root/unsorted/eina/EinaArray01.cs
diff options
context:
space:
mode:
authorLauro Moura <lauromoura@expertisesolutions.com.br>2017-11-23 22:01:25 -0300
committerLauro Moura <lauromoura@expertisesolutions.com.br>2017-12-04 15:47:51 -0300
commit06b582e6e80c536820d1ac1a737c3755092eb65e (patch)
treeb8504c62bc23a85afb0df34a09af494bee4b3400 /unsorted/eina/EinaArray01.cs
parent379d7cc1282af876fdccf5059a3eec7f8c513f3f (diff)
efl_mono: Add examples code.
Buildsystem support will be enabled in a future commit
Diffstat (limited to 'unsorted/eina/EinaArray01.cs')
-rw-r--r--unsorted/eina/EinaArray01.cs41
1 files changed, 41 insertions, 0 deletions
diff --git a/unsorted/eina/EinaArray01.cs b/unsorted/eina/EinaArray01.cs
new file mode 100644
index 00000000..4ac4a778
--- /dev/null
+++ b/unsorted/eina/EinaArray01.cs
@@ -0,0 +1,41 @@
1using static System.Console;
2
3public class ExampleEinaArray01
4{
5 public static void Main()
6 {
7 eina.Config.Init();
8
9 var strings = new string[]{
10 "helo", "hera", "starbuck", "kat", "boomer",
11 "hotdog", "longshot", "jammer", "crashdown", "hardball",
12 "duck", "racetrack", "apolo", "husker", "freaker",
13 "skulls", "bulldog", "flat top", "hammerhead", "gonzo"
14 };
15
16 var array = new eina.Array<string>(20U);
17
18 // Push new elements
19 foreach (string s in strings)
20 {
21 WriteLine("push: " + s);
22 array.Push(s);
23 }
24
25 // Check count
26 WriteLine("array count: " + array.Count());
27
28 // Iterate over the array
29 int idx = 0;
30 foreach (string s in array)
31 {
32 WriteLine($"at[{idx}]: {s}");
33 ++idx;
34 }
35
36 // Remove one by one
37 while (array.Length != 0)
38 WriteLine("pop: " + array.Pop());
39 }
40}
41