public static void utc_eldbus_introspect_p() { var conn = new eldbus.Connection(eldbus.Connection.Type.System); var obj = new eldbus.Object(conn, DBusBus, DBusPath); IntPtr timeout = IntPtr.Zero; int messageCapture = 0; bool isSuccess = false; eldbus.MessageDelegate objectMessageCb = delegate(eldbus.Message msg, eldbus.Pending p) { try { if (timeout != IntPtr.Zero) { ecore_timer_del(timeout); timeout = IntPtr.Zero; } string errname; string errmsg; if (messageCapture == 5) { if (!msg.GetError(out errname, out errmsg)) { string txt; if (msg.Get(out txt)) { if (!String.IsNullOrEmpty(txt)) { isSuccess = true; } } } } } finally { ecore_main_loop_quit(); } }; eldbus.Pending pending = obj.Introspect(objectMessageCb); AssertEquals(pending.GetMethod(), "Introspect"); timeout = ecore_timer_add(2.0, GetEcoreLoopClose(), IntPtr.Zero); Assert(timeout != IntPtr.Zero); messageCapture = 5; ecore_main_loop_begin(); Assert(isSuccess, "Method Introspect is not call"); obj.Dispose(); conn.Dispose(); }
public static void utc_eldbus_introspect_p() { var app = Efl.App.AppMain; var conn = new eldbus.Connection(eldbus.Connection.Type.Session); var obj = new eldbus.Object(conn, DBusBus, DBusPath); int messageCapture = 0; bool isSuccess = false; eldbus.MessageDelegate objectMessageCb = delegate(eldbus.Message msg, eldbus.Pending p) { try { string errname; string errmsg; if (messageCapture == 5) { if (!msg.GetError(out errname, out errmsg)) { string txt; if (msg.Get(out txt)) { if (!String.IsNullOrEmpty(txt)) { isSuccess = true; } } } } } finally { app.Quit(0); } }; eldbus.Pending pending = obj.Introspect(objectMessageCb); AssertEquals(pending.GetMethod(), "Introspect"); var timer = new Efl.LoopTimer(app, 2.0); timer.TimerTickEvent += (object sender, EventArgs e) => { app.Quit(0); }; messageCapture = 5; app.Begin(); Assert(isSuccess, "Method Introspect is not call"); timer.Dispose(); obj.Dispose(); conn.Dispose(); }
public Proxy(eldbus.Object obj, string _interface) { InitNew(eldbus_proxy_get(obj.Handle, _interface), true); }
public static void utc_eldbus_object_send_info_get_p() { var app = Efl.App.AppMain; var conn = new eldbus.Connection(eldbus.Connection.Type.Session); var obj = new eldbus.Object(conn, DBusBus, DBusPath); string busFromObject = obj.GetBusName(); AssertEquals(DBusBus, busFromObject); string pathFromObject = obj.GetPath(); AssertEquals(DBusPath, pathFromObject); obj.Ref(); obj.Unref(); { var connectionFromObj = obj.GetConnection(); Assert(conn.Handle == connectionFromObj.Handle); connectionFromObj.Dispose(); } int messageCapture = 0; bool isSuccess = false; eldbus.MessageDelegate objectMessageCb = delegate(eldbus.Message msg, eldbus.Pending p) { try { string errname; string errmsg; if (messageCapture == 5) { if (!msg.GetError(out errname, out errmsg)) { string txt; if (msg.Get(out txt)) { if (!String.IsNullOrEmpty(txt)) { isSuccess = true; } } } } } finally { app.Quit(0); } }; var methodName = "GetId"; var message = obj.NewMethodCall(DBusInterface, methodName); eldbus.Pending pending = obj.Send(message, objectMessageCb, -1); AssertEquals(pending.GetMethod(), methodName); var timer = new Efl.LoopTimer(app, 2.0); timer.TimerTickEvent += (object sender, EventArgs e) => { app.Quit(0); }; messageCapture = 5; app.Begin(); Assert(isSuccess, $"Method {methodName} is not call"); timer.Dispose(); message.Dispose(); obj.Dispose(); conn.Dispose(); }
/// <summary> /// Constructor /// <para>Since EFL 1.23.</para> /// </summary> /// <param name="obj">The <see cref="eldbus.Object" />.</param> /// <param name="_interface">The interface name.</param> public Proxy(eldbus.Object obj, string _interface) { Contract.Requires(obj != null, nameof(obj)); InitNew(eldbus_proxy_get(obj.Handle, _interface), true); }
public static void utc_eldbus_object_send_info_get_p() { var conn = new eldbus.Connection(eldbus.Connection.Type.System); var obj = new eldbus.Object(conn, DBusBus, DBusPath); string busFromObject = obj.GetBusName(); AssertEquals(DBusBus, busFromObject); string pathFromObject = obj.GetPath(); AssertEquals(DBusPath, pathFromObject); obj.Ref(); obj.Unref(); { var connectionFromObj = obj.GetConnection(); Assert(conn.Handle == connectionFromObj.Handle); connectionFromObj.Dispose(); } IntPtr timeout = IntPtr.Zero; int messageCapture = 0; bool isSuccess = false; eldbus.MessageDelegate objectMessageCb = delegate(eldbus.Message msg, eldbus.Pending p) { try { if (timeout != IntPtr.Zero) { ecore_timer_del(timeout); timeout = IntPtr.Zero; } string errname; string errmsg; if (messageCapture == 5) { if (!msg.GetError(out errname, out errmsg)) { string txt; if (msg.Get(out txt)) { if (!String.IsNullOrEmpty(txt)) { isSuccess = true; } } } } } finally { ecore_main_loop_quit(); } }; var methodName = "GetId"; var message = obj.NewMethodCall(DBusInterface, methodName); eldbus.Pending pending = obj.Send(message, objectMessageCb, -1); AssertEquals(pending.GetMethod(), methodName); timeout = ecore_timer_add(2.0, GetEcoreLoopClose(), IntPtr.Zero); Assert(timeout != IntPtr.Zero); messageCapture = 5; ecore_main_loop_begin(); Assert(isSuccess, $"Method {methodName} is not call"); message.Dispose(); obj.Dispose(); conn.Dispose(); }