diff options
author | Jaehyun Cho <jae_hyun.cho@samsung.com> | 2019-09-02 21:26:58 +0900 |
---|---|---|
committer | Jaehyun Cho <jae_hyun.cho@samsung.com> | 2019-09-02 21:35:23 +0900 |
commit | b7bab9aa8e70fee0c44411746e6955c14cd9701a (patch) | |
tree | 7df65e9c5d53a31838a0545c8e4632bcd3b7a294 | |
parent | ac99e2ac9410d5b2ef6225fa1aaaf9ffcd6578fb (diff) | |
download | efl-b7bab9aa8e70fee0c44411746e6955c14cd9701a.tar.gz |
csharp: add SetKeyValue and GetKeyValue to EoWrapper
Summary:
SetKeyValue adds a value object associated with a key object to hash
table.
GetKeyValue returns a value object associated with a key object from
hash table.
Reviewers: felipealmeida, lauromoura, vitor.sousa, woohyun, cedric
Subscribers: zmike, bu5hm4n, segfaultxavi, #reviewers, #committers
Tags: #efl
Differential Revision: https://phab.enlightenment.org/D9622
-rw-r--r-- | src/bindings/mono/eo_mono/EoWrapper.cs | 24 |
1 files changed, 24 insertions, 0 deletions
diff --git a/src/bindings/mono/eo_mono/EoWrapper.cs b/src/bindings/mono/eo_mono/EoWrapper.cs index c2ee5e2a31..688de85cae 100644 --- a/src/bindings/mono/eo_mono/EoWrapper.cs +++ b/src/bindings/mono/eo_mono/EoWrapper.cs @@ -3,6 +3,7 @@ using System.Runtime.InteropServices; using System.Runtime.CompilerServices; using System.Threading; using System.Reflection; +using System.Collections; namespace Efl { @@ -26,6 +27,7 @@ public abstract class EoWrapper : IWrapper, IDisposable private static Efl.EventCb ownershipUniqueDelegate = new Efl.EventCb(OwnershipUniqueCallback); private static Efl.EventCb ownershipSharedDelegate = new Efl.EventCb(OwnershipSharedCallback); + private Hashtable keyValueHash = null; /// <summary>Constructor to be used when objects are expected to be constructed from native code. /// For a class that inherited from an EFL# class to be properly constructed from native code @@ -322,6 +324,28 @@ public abstract class EoWrapper : IWrapper, IDisposable public IntPtr NativeHandle { get; private set; } } + /// <summary> + /// Set a value object associated with a key object. + /// </summary> + public void SetKeyValue(object key, object val) + { + if (keyValueHash == null) + keyValueHash = new Hashtable(); + + keyValueHash.Add(key, val); + } + + /// <summary> + /// Get a value object associated with a key object. + /// </summary> + public object GetKeyValue(object key) + { + if (keyValueHash == null) + return null; + + return keyValueHash[key]; + } + /// <summary>Wrapper for native methods and virtual method delegates. /// For internal use by generated code only.</summary> public abstract class NativeMethods : Efl.Eo.NativeClass |