summaryrefslogtreecommitdiff
path: root/reference
diff options
context:
space:
mode:
authorXavi Artigas <xavierartigas@yahoo.es>2019-01-15 13:19:08 +0100
committerXavi Artigas <xavierartigas@yahoo.es>2019-01-15 13:19:08 +0100
commita5c08814d897e6c00729b61e3886532b7e942705 (patch)
treed6ca3bc47827cca95702d252b9d0ab31e98c64a3 /reference
parente06157c1f625adc2fe7c1df79a0148308bf67e57 (diff)
examples-mono: Update Eina comments to latest syntax
Diffstat (limited to 'reference')
-rw-r--r--reference/csharp/eina/src/eina_array.cs24
-rw-r--r--reference/csharp/eina/src/eina_hash.cs16
-rw-r--r--reference/csharp/eina/src/eina_iterator.cs10
-rw-r--r--reference/csharp/eina/src/eina_list.cs14
-rw-r--r--reference/csharp/eina/src/eina_log.cs6
-rw-r--r--reference/csharp/eina/src/eina_value.cs8
6 files changed, 39 insertions, 39 deletions
diff --git a/reference/csharp/eina/src/eina_array.cs b/reference/csharp/eina/src/eina_array.cs
index 9cf9d549..dd7a3be8 100644
--- a/reference/csharp/eina/src/eina_array.cs
+++ b/reference/csharp/eina/src/eina_array.cs
@@ -1,8 +1,8 @@
1/* 1/*
2 * Eina Array examples. 2 * Eina.Array examples.
3 * 3 *
4 * These examples demonstrate how to work with Eina_array data and methods. 4 * These examples demonstrate how to work with Eina.Array data and methods.
5 * We use a simple array of strings to initialise our Eina_array before 5 * We use a simple array of strings to initialise our Eina.Array before
6 * performing various mutations and printing the results. 6 * performing various mutations and printing the results.
7 */ 7 */
8 8
@@ -12,7 +12,7 @@ public class Example
12{ 12{
13 static Eina.Array<string> CreateArray() 13 static Eina.Array<string> CreateArray()
14 { 14 {
15 // some content to populate our array 15 // Some content to populate our array
16 string[] names = 16 string[] names =
17 { 17 {
18 "helo", "hera", "starbuck", "kat", "boomer", 18 "helo", "hera", "starbuck", "kat", "boomer",
@@ -21,7 +21,7 @@ public class Example
21 "skulls", "bulldog", "flat top", "hammerhead", "gonzo" 21 "skulls", "bulldog", "flat top", "hammerhead", "gonzo"
22 }; 22 };
23 23
24 // set up an array with a growth step to give a little headroom 24 // Set up an array with a growth step to give a little headroom
25 var array = new Eina.Array<string>(25u); 25 var array = new Eina.Array<string>(25u);
26 26
27 foreach (string name in names) 27 foreach (string name in names)
@@ -32,7 +32,7 @@ public class Example
32 32
33 static bool ItemRemoveCb(string name) 33 static bool ItemRemoveCb(string name)
34 { 34 {
35 // let's keep any strings that are no more than 7 characters long 35 // Let's keep any strings that are no more than 7 characters long
36 if (name.Length <= 7) 36 if (name.Length <= 7)
37 return false; 37 return false;
38 return true; 38 return true;
@@ -44,24 +44,24 @@ public class Example
44 44
45 var array = CreateArray(); 45 var array = CreateArray();
46 46
47 // show the contents of our array 47 // Show the contents of our array
48 Console.WriteLine("Array count: {0}", array.Count()); 48 Console.WriteLine("Array count: {0}", array.Count());
49 Console.WriteLine("Array contents:"); 49 Console.WriteLine("Array contents:");
50 foreach(string name in array) 50 foreach(string name in array)
51 { 51 {
52 // content is strings so we simply print the data 52 // Content is strings so we simply print the data
53 Console.WriteLine(" {0}", name); 53 Console.WriteLine(" {0}", name);
54 } 54 }
55 55
56 // access a specific item in the array 56 // Access a specific item in the array
57 Console.WriteLine("Top gun: {0}", array[2]); 57 Console.WriteLine("Top gun: {0}", array[2]);
58 58
59 // update a single item in the array 59 // Update a single item in the array
60 array[17] = "flattop"; 60 array[17] = "flattop";
61 // update the array removing items that match the ItemRemoveCb criteria 61 // Update the array removing items that match the ItemRemoveCb criteria
62 // array.RemoveAll(ItemRemoveCb); // TODO: FIXME 62 // array.RemoveAll(ItemRemoveCb); // TODO: FIXME
63 63
64 // print the new contents of our array 64 // Print the new contents of our array
65 Console.WriteLine("New array count: {0}", array.Length); 65 Console.WriteLine("New array count: {0}", array.Length);
66 Console.WriteLine("New array contents:"); 66 Console.WriteLine("New array contents:");
67 foreach(string name in array) 67 foreach(string name in array)
diff --git a/reference/csharp/eina/src/eina_hash.cs b/reference/csharp/eina/src/eina_hash.cs
index 19c3db0c..7b155e70 100644
--- a/reference/csharp/eina/src/eina_hash.cs
+++ b/reference/csharp/eina/src/eina_hash.cs
@@ -1,7 +1,7 @@
1/* 1/*
2 * Eina Hash examples. 2 * Eina.Hash examples.
3 * 3 *
4 * These examples demonstrate how to work with Eina_hash data and methods. 4 * These examples demonstrate how to work with Eina.Hash data and methods.
5 * 5 *
6 * We have two main hash objects here, firstly an int keyed hash with some 6 * We have two main hash objects here, firstly an int keyed hash with some
7 * dummy content. 7 * dummy content.
@@ -16,7 +16,7 @@ public class Example
16{ 16{
17 static Eina.Hash<Int32, string> CreateHash() 17 static Eina.Hash<Int32, string> CreateHash()
18 { 18 {
19 // let's create a simple hash with integers as keys 19 // Let's create a simple hash with integers as keys
20 var hash = new Eina.Hash<Int32, string>(); 20 var hash = new Eina.Hash<Int32, string>();
21 21
22 // Add initial entries to our hash 22 // Add initial entries to our hash
@@ -30,13 +30,13 @@ public class Example
30 { 30 {
31 var hash = CreateHash(); 31 var hash = CreateHash();
32 32
33 // get an iterator of the keys so we can print a line per entry 33 // Get an iterator of the keys so we can print a line per entry
34 var iter = hash.Keys(); 34 var iter = hash.Keys();
35 35
36 Console.WriteLine("Print contents of int hash"); 36 Console.WriteLine("Print contents of int hash");
37 foreach (int key in iter) 37 foreach (int key in iter)
38 { 38 {
39 // look up the value for the key so we can print both 39 // Look up the value for the key so we can print both
40 string value = hash.Find(key); 40 string value = hash.Find(key);
41 Console.WriteLine($" Item found with id {key} has value {value}"); 41 Console.WriteLine($" Item found with id {key} has value {value}");
42 } 42 }
@@ -46,7 +46,7 @@ public class Example
46 hash.Dispose(); 46 hash.Dispose();
47 } 47 }
48 48
49 // here we begin the phone book example 49 // Here we begin the phone book example
50 50
51 static void PrintPhonebookEntry(string key, string data) 51 static void PrintPhonebookEntry(string key, string data)
52 { 52 {
@@ -58,7 +58,7 @@ public class Example
58 int count = book.Population(); 58 int count = book.Population();
59 Console.WriteLine($"Complete phone book ({count}):"); 59 Console.WriteLine($"Complete phone book ({count}):");
60 60
61 // as an enumerator, iterate over the key and value for each entry 61 // As an enumerator, iterate over the key and value for each entry
62 foreach (KeyValuePair<string, string> kvp in book) 62 foreach (KeyValuePair<string, string> kvp in book)
63 PrintPhonebookEntry(kvp.Key, kvp.Value); 63 PrintPhonebookEntry(kvp.Key, kvp.Value);
64 64
@@ -78,7 +78,7 @@ public class Example
78 "+23 45 678-91012", "+34 56 789-10123" 78 "+23 45 678-91012", "+34 56 789-10123"
79 }; 79 };
80 80
81 // create hash of strings to strings 81 // Create hash of strings to strings
82 var hash = new Eina.Hash<string, string>(); 82 var hash = new Eina.Hash<string, string>();
83 83
84 // Add initial entries to our hash 84 // Add initial entries to our hash
diff --git a/reference/csharp/eina/src/eina_iterator.cs b/reference/csharp/eina/src/eina_iterator.cs
index 54f02ffa..61d31dca 100644
--- a/reference/csharp/eina/src/eina_iterator.cs
+++ b/reference/csharp/eina/src/eina_iterator.cs
@@ -1,9 +1,9 @@
1 1
2/* 2/*
3 * Eina Iterator examples. 3 * Eina.Iterator examples.
4 * 4 *
5 * These examples demonstrate how to work with Eina_iterator methods. 5 * These examples demonstrate how to work with Eina.Iterator methods.
6 * Both an Eina_list and an Eina_array are created and an iterator obtained 6 * Both an Eina.List and an Eina.Array are created and an iterator obtained
7 * for both. You can see how we can use iterators irrespective of the source 7 * for both. You can see how we can use iterators irrespective of the source
8 * and also that there are different ways to work with iterating content. 8 * and also that there are different ways to work with iterating content.
9 */ 9 */
@@ -59,14 +59,14 @@ public class Example
59 { 59 {
60 Efl.All.Init(); 60 Efl.All.Init();
61 61
62 // create an Eina.Array and iterate through it's contents 62 // Create an Eina.Array and iterate through its contents
63 var array = CreateArray(); 63 var array = CreateArray();
64 var it = array.GetIterator(); 64 var it = array.GetIterator();
65 PrintIterator(it); 65 PrintIterator(it);
66 it.Dispose(); 66 it.Dispose();
67 array.Dispose(); 67 array.Dispose();
68 68
69 // perform the same iteration with an Eina.List 69 // Perform the same iteration with an Eina.List
70 var list = CreateList(); 70 var list = CreateList();
71 it = list.GetIterator(); 71 it = list.GetIterator();
72 PrintIterator(it); 72 PrintIterator(it);
diff --git a/reference/csharp/eina/src/eina_list.cs b/reference/csharp/eina/src/eina_list.cs
index ecdf7d31..e04dc205 100644
--- a/reference/csharp/eina/src/eina_list.cs
+++ b/reference/csharp/eina/src/eina_list.cs
@@ -1,8 +1,8 @@
1 1
2/* 2/*
3 * Eina List examples. 3 * Eina.List examples.
4 * 4 *
5 * These examples demonstrate how to work with Eina_list data and methods. 5 * These examples demonstrate how to work with Eina.List data and methods.
6 * We create a simple list of names by appending strings to an empty list 6 * We create a simple list of names by appending strings to an empty list
7 * and then run various mutations and print each result. 7 * and then run various mutations and print each result.
8 */ 8 */
@@ -29,13 +29,13 @@ public class Example
29 29
30 var list = CreateList(); 30 var list = CreateList();
31 31
32 // print our list with a simple foreach 32 // Print our list with a simple foreach
33 Console.WriteLine("List size: {0}", list.Count()); 33 Console.WriteLine("List size: {0}", list.Count());
34 Console.WriteLine("List content:"); 34 Console.WriteLine("List content:");
35 foreach(string item in list) 35 foreach(string item in list)
36 Console.WriteLine(" {0}", item); 36 Console.WriteLine(" {0}", item);
37 37
38 // insert some more elements 38 // Insert some more elements
39 list.Prepend("Cain"); 39 list.Prepend("Cain");
40// list.PrependRelative("Tigh", "Baltar"); // TODO: missing 40// list.PrependRelative("Tigh", "Baltar"); // TODO: missing
41 41
@@ -43,7 +43,7 @@ public class Example
43 foreach(string item in list) 43 foreach(string item in list)
44 Console.WriteLine(" {0}", item); 44 Console.WriteLine(" {0}", item);
45 45
46 // promote an item to the top of the list 46 // Promote an item to the top of the list
47 // TODO: implement ? 47 // TODO: implement ?
48// list.PromoteList(list.NthList(1)); 48// list.PromoteList(list.NthList(1));
49// list.Remove("Cain"); 49// list.Remove("Cain");
@@ -52,14 +52,14 @@ public class Example
52// foreach(string item in list) 52// foreach(string item in list)
53// Console.WriteLine(" {0}", item); 53// Console.WriteLine(" {0}", item);
54 54
55 // we can sort the list with any callback 55 // We can sort the list with any callback
56// list.Sort((string strA, string strB) => { return strA.Compare(strB); }); // TODO: FIXME custom sort 56// list.Sort((string strA, string strB) => { return strA.Compare(strB); }); // TODO: FIXME custom sort
57 list.Sort(); 57 list.Sort();
58 Console.WriteLine("List content sorted:"); 58 Console.WriteLine("List content sorted:");
59 foreach(string item in list) 59 foreach(string item in list)
60 Console.WriteLine(" {0}", item); 60 Console.WriteLine(" {0}", item);
61 61
62 // and foreach can be in reverse too 62 // And foreach can be in reverse too
63 Console.WriteLine("List content reverse sorted:"); 63 Console.WriteLine("List content reverse sorted:");
64 foreach(string item in list.Reverse()) 64 foreach(string item in list.Reverse())
65 Console.WriteLine(" {0}", item); 65 Console.WriteLine(" {0}", item);
diff --git a/reference/csharp/eina/src/eina_log.cs b/reference/csharp/eina/src/eina_log.cs
index 0e8664bd..86627e9f 100644
--- a/reference/csharp/eina/src/eina_log.cs
+++ b/reference/csharp/eina/src/eina_log.cs
@@ -1,6 +1,6 @@
1 1
2/* 2/*
3 * Efl Core Log examples. 3 * Eina.Log examples.
4 * 4 *
5 * This demo shows how to log at various levels and to change what log is shown. 5 * This demo shows how to log at various levels and to change what log is shown.
6 * You can also use a custom log printer in your app as shown in _log_custom. 6 * You can also use a custom log printer in your app as shown in _log_custom.
@@ -40,11 +40,11 @@ public class Example
40 Divides(); 40 Divides();
41 41
42 Eina.Log.GlobalLevelSet(Eina.Log.Level.Warning); 42 Eina.Log.GlobalLevelSet(Eina.Log.Level.Warning);
43 Console.WriteLine("Executing with Warning level"); // same as EINA_LOG_LEVEL = 2 43 Console.WriteLine("Executing with Warning level"); // Same as EINA_LOG_LEVEL = 2
44 Divides(); 44 Divides();
45 45
46 Eina.Log.GlobalLevelSet(Eina.Log.Level.Info); 46 Eina.Log.GlobalLevelSet(Eina.Log.Level.Info);
47 Console.WriteLine("Executing with Info on"); // same as EINA_LOG_LEVEL = 3 47 Console.WriteLine("Executing with Info on"); // Same as EINA_LOG_LEVEL = 3
48 Divides(); 48 Divides();
49 } 49 }
50 50
diff --git a/reference/csharp/eina/src/eina_value.cs b/reference/csharp/eina/src/eina_value.cs
index d718b6b5..3f3308ea 100644
--- a/reference/csharp/eina/src/eina_value.cs
+++ b/reference/csharp/eina/src/eina_value.cs
@@ -1,10 +1,10 @@
1/* 1/*
2 * Eina Value examples. 2 * Eina.Value examples.
3 * 3 *
4 * These examples demonstrate how to work with Eina_value data and methods. 4 * These examples demonstrate how to work with Eina.Value data and methods.
5 * Eina_Value is a way to represent and pass data of varying types and to 5 * Eina.Value is a way to represent and pass data of varying types and to
6 * convert efficiently between them. 6 * convert efficiently between them.
7 * Eina_Value can even define structs for managing more complex requirements. 7 * Eina.Value can even define structs for managing more complex requirements.
8 */ 8 */
9 9
10using System; 10using System;