diff --git a/src/bindings/mono/eldbus_mono/eldbus_object.cs b/src/bindings/mono/eldbus_mono/eldbus_object.cs index d86ad6cc61..7c7e325a5e 100644 --- a/src/bindings/mono/eldbus_mono/eldbus_object.cs +++ b/src/bindings/mono/eldbus_mono/eldbus_object.cs @@ -1,7 +1,7 @@ - #pragma warning disable 1591 using System.Runtime.InteropServices; +using System.ComponentModel; using static eldbus.EldbusObjectNativeFunctions; @@ -10,6 +10,7 @@ using IntPtr = System.IntPtr; namespace eldbus { +[EditorBrowsable(EditorBrowsableState.Never)] public static class EldbusObjectNativeFunctions { [DllImport(efl.Libs.Eldbus)] public static extern IntPtr @@ -83,15 +84,18 @@ public static class EldbusObjectNativeFunctions } /// Represents a DBus object. -/// -/// Since EFL 1.23. +/// Since EFL 1.23. /// public class Object : System.IDisposable { - + [EditorBrowsable(EditorBrowsableState.Never)] public IntPtr Handle {get;set;} = IntPtr.Zero; + /// Whether this managed list owns the native one. + /// Since EFL 1.23. + /// public bool Own {get;set;} = true; + [EditorBrowsable(EditorBrowsableState.Never)] private void InitNew(IntPtr handle, bool own) { Handle = handle; @@ -107,11 +111,21 @@ public class Object : System.IDisposable } } + [EditorBrowsable(EditorBrowsableState.Never)] public Object(IntPtr handle, bool own) { InitNew(handle, own); } + /// + /// Constructor. + /// Since EFL 1.23. + /// + /// where object + /// belongs. + /// The name of the bus or unique id who listens for calls + /// of this object + /// The object path of this object. public Object(eldbus.Connection conn, string bus, string path) { if (conn == null) @@ -139,11 +153,20 @@ public class Object : System.IDisposable InitNew(handle, true); } + /// Finalizes with garbage collector. + /// Since EFL 1.23. + /// ~Object() { Dispose(false); } + + /// Disposes of this list. + /// Since EFL 1.23. + /// + /// Whether this was called from the finalizer (false) or from the + /// method. protected virtual void Dispose(bool disposing) { IntPtr h = Handle; @@ -166,17 +189,28 @@ public class Object : System.IDisposable } } + /// Disposes of this list. + /// Since EFL 1.23. + /// public void Dispose() { Dispose(true); System.GC.SuppressFinalize(this); } + /// Releases the native resources held by this instance. + /// Since EFL 1.23. + /// public void Free() { Dispose(); } + /// + /// Releases the native handler. + /// Since EFL 1.23. + /// + /// The native handler. public IntPtr Release() { IntPtr h = Handle; @@ -184,6 +218,12 @@ public class Object : System.IDisposable return h; } + /// + /// Get the object associated with a + /// + /// Since EFL 1.23. + /// + /// The object public eldbus.Connection GetConnection() { CheckHandle(); @@ -197,6 +237,12 @@ public class Object : System.IDisposable return new eldbus.Connection(conn, false); } + /// + /// Get the name associated with a + /// Since EFL 1.23. + /// + /// A string corresponding to the + /// name public string GetBusName() { CheckHandle(); @@ -204,6 +250,12 @@ public class Object : System.IDisposable return Eina.StringConversion.NativeUtf8ToManagedString(ptr); } + /// + /// Get the path associated with a + /// Since EFL 1.23. + /// + /// A string corresponding to the + /// path. public string GetPath() { CheckHandle(); @@ -211,18 +263,37 @@ public class Object : System.IDisposable return Eina.StringConversion.NativeUtf8ToManagedString(ptr); } + /// + /// Increse object reference + /// Since EFL 1.23. + /// public void Ref() { CheckHandle(); eldbus_object_ref(Handle); } + /// + /// Decrease object reference. + /// If reference == 0 object will be freed and all its children. + /// + /// Since EFL 1.23. + /// + /// public void Unref() { CheckHandle(); eldbus_object_unref(Handle); } + /// + /// Send a message + /// Since EFL 1.23. + /// + /// The message will be sent in connection to this object. + /// The function to call when receiving answer. + /// Timeout. + /// A public eldbus.Pending Send(eldbus.Message msg, eldbus.MessageDelegate dlgt = null, double timeout = -1) { CheckHandle(); @@ -245,6 +316,13 @@ public class Object : System.IDisposable return new eldbus.Pending(pending_hdl, false); } + /// + /// Call a dbus method on the . + /// Since EFL 1.23. + /// + /// The interface name. + /// Name of the method to be called. + /// A new public eldbus.Message NewMethodCall(string _interface, string member) { CheckHandle(); @@ -259,6 +337,12 @@ public class Object : System.IDisposable return new eldbus.Message(hdl, false); } + /// + /// Call the method Ping on the eldbus. + /// Since EFL 1.23. + /// + /// The function to call when receiving answer. + /// A public eldbus.Pending PeerPing(eldbus.MessageDelegate dlgt = null) { CheckHandle(); @@ -276,6 +360,12 @@ public class Object : System.IDisposable return new eldbus.Pending(pending_hdl, false); } + /// + /// Call the method GetMachineId on the eldbus. + /// Since EFL 1.23. + /// + /// The function to call when receiving answer. + /// A public eldbus.Pending GetPeerMachineId(eldbus.MessageDelegate dlgt = null) { CheckHandle(); @@ -293,6 +383,12 @@ public class Object : System.IDisposable return new eldbus.Pending(pending_hdl, false); } + /// + /// Call the method Introspect on the eldbus. + /// Since EFL 1.23. + /// + /// The function to call when receiving answer. + /// A public eldbus.Pending Introspect(eldbus.MessageDelegate dlgt = null) { CheckHandle(); @@ -310,6 +406,12 @@ public class Object : System.IDisposable return new eldbus.Pending(pending_hdl, false); } + /// + /// Call the method GetmanagedObjects on eldbus. + /// Since EFL 1.23. + /// + /// The function to call when receiving answer. + /// A public eldbus.Pending GetManagedObjects(eldbus.MessageDelegate dlgt = null) { CheckHandle();