Page MenuHomePhabricator

csharp: Add helpers to get/set Values from Objects
ClosedPublic

Authored by lauromoura on Jul 10 2019, 2:46 PM.

Details

Summary

The user can construct an Eina.Value from a plain C# object, using
reflection to get the correct type of object and construct the correct
underlying C value.

Also added the Unwrap() method to return a C# object representing the
wrapped value.

Both operations are useful when using Eina.Value to
Get/Set values from PropertyInfo targets as in

var v = new Eina.Value(propInfo.GetValue(sourceObj));
...
propInfo.SetValue(targetObj, v.Unwrap());

Currently, containers are not supported. It will be added in a following
commit.

Depends on D9270

Diff Detail

Repository
rEFL core/efl
Lint
Automatic diff as part of commit; lint not applicable.
Unit
Automatic diff as part of commit; unit tests not applicable.
lauromoura created this revision.Jul 10 2019, 2:46 PM
lauromoura requested review of this revision.Jul 10 2019, 2:46 PM
vitor.sousa accepted this revision.Jul 11 2019, 10:11 AM
This revision is now accepted and ready to land.Jul 11 2019, 10:11 AM
This revision was automatically updated to reflect the committed changes.