-The `eina` namespace provides data types and useful tools which are not available in plain C. The C# runtime though, already provides most of `eina`'s functionality so you will rarely need to use it. The `Eina Programming Guides` are still useful for those EFL methods which use `eina` types as parameters or return types.

+The `Eina` namespace provides data types and useful tools which are not available in plain C. The C# runtime though, already provides most of `Eina`'s functionality so you will rarely need to use it. The `Eina Programming Guides` are still useful for those EFL methods which use `Eina` types as parameters or return types.

-The `eina.Value` class provides storage of and access to generic data, allowing you to store whatever you want in a single `eina.Value` type. It is meant for simple data types, providing uniform access and release functions for the exchange of data while preserving their types. `eina.Value` supports a number of predefined types, can be extended with additional user-provided types and can convert between differing data types including strings.

+The `Eina.Value` class provides storage of and access to generic data, allowing you to store whatever you want in a single `Eina.Value` type. It is meant for simple data types, providing uniform access and release functions for the exchange of data while preserving their types. `Eina.Value` supports a number of predefined types, can be extended with additional user-provided types and can convert between differing data types including strings.

-Examples of `eina.Value` usage can be found in the [EFL examples git repository](https://git.enlightenment.org/tools/examples.git/) in the file [`reference/csharp/eina/src/eina_value.cs`](https://git.enlightenment.org/tools/examples.git/tree/reference/csharp/eina/src/eina_value.cs).

+Examples of `Eina.Value` usage can be found in the [EFL examples git repository](https://git.enlightenment.org/tools/examples.git/) in the file [`reference/csharp/eina/src/eina_value.cs`](https://git.enlightenment.org/tools/examples.git/tree/reference/csharp/eina/src/eina_value.cs).

| | WARNING | |

| --- | ------- | --- |

@@ -16,9 +16,9 @@ Examples of `eina.Value` usage can be found in the [EFL examples git repository]

## Value Types ##

-`eina.Value` can handle the following common *simple* types (found inside the `eina.ValueType` enum):

+`Eina.Value` can handle the following common *simple* types (found inside the `Eina.ValueType` enum):

-New values can be allocated with the standard `new()` operator passing in the desired type as an `eina.ValueType`:

+New values can be allocated with the standard `new()` operator passing in the desired type as an `Eina.ValueType`:

```csharp

-var int_val = new eina.Value(eina.ValueType.Int32);

+var int_val = new Eina.Value(Eina.ValueType.Int32);

```

-When the `int_val` variable goes out of scope any memory allocated internally by the `eina.Value` will be freed as expected.

+When the `int_val` variable goes out of scope any memory allocated internally by the `Eina.Value` will be freed as expected.

### Changing the Type of Simple Values ###

-The type of an `eina.Value` can be changed at any time using `Setup()` and passing in the desired new type:

+The type of an `Eina.Value` can be changed at any time using `Setup()` and passing in the desired new type:

```csharp

-var val = new eina.Value(eina.ValueType.Int32);

-val.Setup(eina.ValueType.Float);

+var val = new Eina.Value(Eina.ValueType.Int32);

+val.Setup(Eina.ValueType.Float);

```

-The content of the `eina.Value` will be destroyed, but **not** the `eina.Value` variable.

+The content of the `Eina.Value` will be destroyed, but **not** the `Eina.Value` variable.

### Accessing the Content of Simple Values ###

-The contents of a simple `eina.Value` can be set with `Set()` and retrieved with `Get()`. Note that the types provided must match the type used when creating the `eina.Value`.

+The contents of a simple `Eina.Value` can be set with `Set()` and retrieved with `Get()`. Note that the types provided must match the type used when creating the `Eina.Value`.

For instance, for integers:

```csharp

-var val = new eina.Value(eina.ValueType.Int32);

+var val = new Eina.Value(Eina.ValueType.Int32);

val.Set(123);

int i;

@@ -78,7 +78,7 @@ val.Get(out i);

Strings are also easily handled:

```csharp

-var val = new eina.Value(eina.ValueType.String);

+var val = new Eina.Value(Eina.ValueType.String);

val.Set("My string");

string str;

@@ -87,33 +87,33 @@ val.Get(out str);

### Copying the Content of a Value ###

-`eina.Value`s are **referenced types**, which means that when you make a copy of an `eina.Value` variable, the underlying value is not copied: both variables point to the same value.

+`Eina.Value`s are **referenced types**, which means that when you make a copy of an `Eina.Value` variable, the underlying value is not copied: both variables point to the same value.

```csharp

-var src = new eina.Value(eina.ValueType.Int32);

+var src = new Eina.Value(Eina.ValueType.Int32);

src.Set(100);

var dst = src;

src.Set(200);

// Now both src and dst contain the integer 200

```

-If you need to create a separate `eina.Value` variable containing the same value, use `new` and initialize it:

+If you need to create a separate `Eina.Value` variable containing the same value, use `new` and initialize it:

```csharp

-var src = new eina.Value(eina.ValueType.Int32);

+var src = new Eina.Value(Eina.ValueType.Int32);

src.Set(100);

-var dst = new eina.Value(src);

+var dst = new Eina.Value(src);

src.Set(200);

// Now src=200 and dst=100

```

### Comparing Two Values ###

-Two `eina.Value`s of the same type can be compared with the standard operators `<`, `==`, `!=` and `>`. The exact meaning of the comparison depends on the value type.

+Two `Eina.Value`s of the same type can be compared with the standard operators `<`, `==`, `!=` and `>`. The exact meaning of the comparison depends on the value type.

```csharp

-var v1 = new eina. Value(eina.ValueType.Float);

-var v2 = new eina. Value(eina.ValueType.Float);

+var v1 = new Eina. Value(Eina.ValueType.Float);

+var v2 = new Eina. Value(Eina.ValueType.Float);

v1.Set(7.0f);

v2.Set(7.5f);

if (v1 > v2) { ... }

@@ -123,11 +123,11 @@ The internal method `v1.Compare(v2)` is also available. The exact meaning of the

### Converting Between Values ###

-Most `eina.Value`s allow conversion from one type to another using the `ConvertTo()` function. The result of the conversion depends on the types in use. This function returns `true` if the conversion is successful. The conversion is typically very strict, meaning that conversion of negative values into unsigned types will fail and values which will not fit in the target type - i.e. conversions that would result in an overflow - will also fail.

+Most `Eina.Value`s allow conversion from one type to another using the `ConvertTo()` function. The result of the conversion depends on the types in use. This function returns `true` if the conversion is successful. The conversion is typically very strict, meaning that conversion of negative values into unsigned types will fail and values which will not fit in the target type - i.e. conversions that would result in an overflow - will also fail.

```csharp

-var v1 = new eina.Value(eina.ValueType.Int);

-var v2 = new eina.Value(eina.ValueType.Float);

+var v1 = new Eina.Value(Eina.ValueType.Int);

+var v2 = new Eina.Value(Eina.ValueType.Float);

v1.Set(7);

v1.ConvertTo(v2);

Console.WriteLine(v2);

@@ -137,32 +137,32 @@ The above code should output `7.0000` on the screen because `v2` is a floating t

### Converting to Strings ###

-All `eina.Value`s allow for conversion into a string, and, for convenience, there is a dedicated conversion method: `ToString()`.

+All `Eina.Value`s allow for conversion into a string, and, for convenience, there is a dedicated conversion method: `ToString()`.

```csharp

-var v1 = new eina.Value(eina.ValueType.Int);

+var v1 = new Eina.Value(Eina.ValueType.Int);

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:

+For convenience, implicit conversion operators also exist between an `Eina.Value` and the actual stored type, so operations like these are possible:

An array is a contiguous block of memory which holds a collection of elements of the same type. Accessing and appending new elements at the end is typically very fast, but removing elements from the beginning or the middle is not.

-**Create** a new array with `new(eina.ValueType.Array, subtype, step)`, or re-configure an existing one with `Setup(eina.ValueType.Array, subtype, step)`. The `subtype` parameter is the type of the `eina.Value`s that will be stored in the array. The `step` parameter indicates how many elements are added to the end of the array every time it needs to be expanded, since it is typically more efficient to enlarge the array by chunks rather than element by element. Its default value is 0 meaning that EFL will choose a value for you.

+**Create** a new array with `new(Eina.ValueType.Array, subtype, step)`, or re-configure an existing one with `Setup(Eina.ValueType.Array, subtype, step)`. The `subtype` parameter is the type of the `Eina.Value`s that will be stored in the array. The `step` parameter indicates how many elements are added to the end of the array every time it needs to be expanded, since it is typically more efficient to enlarge the array by chunks rather than element by element. Its default value is 0 meaning that EFL will choose a value for you.

-A list is a linked collection of `eina.Value`s in which each element contains a pointer to the next element. Insertions and deletions anywhere in the list are typically very fast, but accessing a given position can be slow since it requires traveling through the list.

+A list is a linked collection of `Eina.Value`s in which each element contains a pointer to the next element. Insertions and deletions anywhere in the list are typically very fast, but accessing a given position can be slow since it requires traveling through the list.

-**Create** a new list with `new(eina.ValueType.Array, subtype)`, or configure an existing one with `Setup(subtype)`. The `subtype` parameter is the type of the `eina.Value`s that will be stored in the list.

+**Create** a new list with `new(Eina.ValueType.Array, subtype)`, or configure an existing one with `Setup(subtype)`. The `subtype` parameter is the type of the `Eina.Value`s that will be stored in the list.

-A hash table stores `einva.Value`s indexed by a string key rather than an integer. Insertions, deletions and searches are typically very fast, at the cost of increased memory consumption.

+A hash table stores `Eina.Value`s indexed by a string key rather than an integer. Insertions, deletions and searches are typically very fast, at the cost of increased memory consumption.

> **NOTE:**

-> Implementation of Hash tables inside `eina.Value`s is not complete at this moment.

+> Implementation of Hash tables inside `Eina.Value`s is not complete at this moment.

-**Create** a new hash table with `new(eina.ValueTYpe.Hash, subtype, bucket_size)`, or configure an existing one with `Setup(subtype, bucket_size)`. The `subtype` parameter is the type of the `eina.Value`s that will be stored in the hash table. The `bucket_size` parameter indicates how the table is to be expanded as new elements are added; use 0 and a sane default will be chosen automatically.

+**Create** a new hash table with `new(Eina.ValueType.Hash, subtype, bucket_size)`, or configure an existing one with `Setup(subtype, bucket_size)`. The `subtype` parameter is the type of the `Eina.Value`s that will be stored in the hash table. The `bucket_size` parameter indicates how the table is to be expanded as new elements are added; use 0 and a sane default will be chosen automatically.