diff --git a/ChangeLog b/ChangeLog index c58ddb68d..0bfd7a6a0 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,3 +1,8 @@ +2003-07-05 Martin Willemoes Hansen + + * glib/Object.cs: Changed getData, setData to a single Data property + Different keys are allowed now. + 2003-07-02 Shane Hyde * generator/GenBase.cs : put #line directive after the diff --git a/glib/Object.cs b/glib/Object.cs index 62716d614..98cf9d548 100644 --- a/glib/Object.cs +++ b/glib/Object.cs @@ -37,7 +37,7 @@ namespace GLib { protected bool needs_ref = true; EventHandlerList _events; bool disposed = false; - Hashtable Data; + Hashtable data; static Hashtable Objects = new Hashtable(); static Queue PendingDestroys = new Queue (); static bool idle_queued; @@ -327,35 +327,20 @@ namespace GLib { } /// - /// GetData Method + /// Data property /// /// /// - /// Accesses arbitrary data storage on the Object. + /// Stores and Accesses arbitrary data on the Object. /// - public object GetData (string key) - { - if (Data == null) - return String.Empty; - - return Data [key]; - } - - /// - /// SetData Method - /// - /// - /// - /// Stores arbitrary data on the Object. - /// - - public void SetData (string key, object val) - { - if (Data == null) - Data = new Hashtable (); - - Data [key] = val; + public Hashtable Data { + get { + if (data == null) + data = new Hashtable (); + + return data; + } } [DllImport("libgobject-2.0-0.dll")]