WWW-www.enlightenment.org pushed a commit to branch master. http://git.enlightenment.org/website/www-content.git/commit/?id=f9aff55d38f93ee7d33726b6f57e36e21985d52a
commit f9aff55d38f93ee7d33726b6f57e36e21985d52a Author: Xavi Artigas <[email protected]> Date: Mon Dec 31 08:44:14 2018 -0800 Wiki page generic-value.md changed with summary [Added implicit conversions] by Xavi Artigas --- pages/develop/guides/csharp/eina/generic-value.md.txt | 17 ++++++++++++++++- 1 file changed, 16 insertions(+), 1 deletion(-) diff --git a/pages/develop/guides/csharp/eina/generic-value.md.txt b/pages/develop/guides/csharp/eina/generic-value.md.txt index e4f3f5f11..fe8968755 100644 --- a/pages/develop/guides/csharp/eina/generic-value.md.txt +++ b/pages/develop/guides/csharp/eina/generic-value.md.txt @@ -145,9 +145,24 @@ v1.Set(7); string str = v1.ToString(); ``` +### Implicit Conversions ### + +For convenience, implicit conversion operators also exist between an `eina.Value` and the actual stored type, so operations like these are possible: + +```csharp +eina.Value int_val = 123; +eina.Value str_val = "My string"; +int i = int_val; +string str = str_val; +``` +These conversions allow directly providing native values to EFL methods expecting an `eina.Value`, for example. + +> **NOTE:** +> As with all implicit conversions, use with caution to make sure the compiler is actually choosing the types you expect. + ## Aggregate Values ## -`eina.Value` supports handling collections of simple values through the aggregate types `eina.ValueType.Array`, `eina.ValueType.List` and: `eina.ValueType.Hash`. +`eina.Value` supports handling collections of simple values through the aggregate types `eina.ValueType.Array`, `eina.ValueType.List` and `eina.ValueType.Hash`. All aggregate types allow the operations for simple types described above as well as some specific methods, typically involving construction and access to particular elements within the collection. --
