csharp: Comments in eina_value.cs
Reviewers: lauromoura, vitor.sousa, felipealmeida Reviewed By: vitor.sousa Differential Revision: https://phab.enlightenment.org/D6996
This commit is contained in:
parent
a473380cc7
commit
accd628bd3
|
@ -1,10 +1,9 @@
|
||||||
|
|
||||||
/*
|
/*
|
||||||
* Eina Value examples.
|
* Eina Value examples.
|
||||||
*
|
*
|
||||||
* These examples demonstrate how to work with eina_value data and methods.
|
* These examples demonstrate how to work with eina_value data and methods.
|
||||||
* Eina_Value is a way to represent and pass data of varying types and to
|
* Eina_Value is a way to represent and pass data of varying types and to
|
||||||
* convert efficiently between them..
|
* convert efficiently between them.
|
||||||
* Eina_Value can even define structs for managing more complex requirements.
|
* Eina_Value can even define structs for managing more complex requirements.
|
||||||
*/
|
*/
|
||||||
|
|
||||||
|
@ -22,7 +21,7 @@ public class Example
|
||||||
int_val.Get(out i);
|
int_val.Get(out i);
|
||||||
Console.WriteLine("int_val value is {0}", i);
|
Console.WriteLine("int_val value is {0}", i);
|
||||||
|
|
||||||
// It can easily be converted it to a string
|
// It can easily be converted to a string
|
||||||
string str = int_val.ToString();
|
string str = int_val.ToString();
|
||||||
Console.WriteLine("int_val to string is \"{0}\"", str);
|
Console.WriteLine("int_val to string is \"{0}\"", str);
|
||||||
int_val.Flush();
|
int_val.Flush();
|
||||||
|
@ -46,11 +45,11 @@ public class Example
|
||||||
|
|
||||||
static void ValueConvert()
|
static void ValueConvert()
|
||||||
{
|
{
|
||||||
// set up string and int types to convert between
|
// Set up string and int types to convert between
|
||||||
var str_val = new eina.Value(eina.ValueType.String);
|
var str_val = new eina.Value(eina.ValueType.String);
|
||||||
var int_val = new eina.Value(eina.ValueType.Int32);
|
var int_val = new eina.Value(eina.ValueType.Int32);
|
||||||
|
|
||||||
// convert from int to string:
|
// Convert from int to string:
|
||||||
int i1;
|
int i1;
|
||||||
string str1;
|
string str1;
|
||||||
int_val.Set(123);
|
int_val.Set(123);
|
||||||
|
@ -59,7 +58,7 @@ public class Example
|
||||||
str_val.Get(out str1);
|
str_val.Get(out str1);
|
||||||
Console.WriteLine("int_val was {0}, converted to string is \"{1}\"", i1, str1);
|
Console.WriteLine("int_val was {0}, converted to string is \"{1}\"", i1, str1);
|
||||||
|
|
||||||
// and the other way around!
|
// And the other way around!
|
||||||
int i2;
|
int i2;
|
||||||
string str2;
|
string str2;
|
||||||
str_val.Set("33");
|
str_val.Set("33");
|
||||||
|
@ -85,9 +84,6 @@ public class Example
|
||||||
ValueConvert();
|
ValueConvert();
|
||||||
Console.WriteLine("");
|
Console.WriteLine("");
|
||||||
|
|
||||||
// TODO: FIXME
|
|
||||||
// ValueStruct();
|
|
||||||
|
|
||||||
efl.All.Shutdown();
|
efl.All.Shutdown();
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in New Issue