This repository has been archived by the owner on Nov 8, 2022. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 59
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Start export test, hack interface to not return enums
- Loading branch information
Alp Toker
committed
Aug 27, 2006
1 parent
e237ff7
commit 7765ded
Showing
3 changed files
with
54 additions
and
2 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,46 @@ | ||
// Copyright 2006 Alp Toker <alp@atoker.com> | ||
// This software is made available under the MIT License | ||
// See COPYING for details | ||
|
||
using System; | ||
using NDesk.DBus; | ||
using org.freedesktop.DBus; | ||
|
||
public class ManagedDBusTestExport | ||
{ | ||
public static void Main () | ||
{ | ||
Connection conn = new Connection (); | ||
|
||
ObjectPath opath = new ObjectPath ("/org/freedesktop/DBus"); | ||
string name = "org.freedesktop.DBus"; | ||
|
||
DProxy prox = new DProxy (conn, opath, name, typeof (Bus)); | ||
Bus bus = (Bus)prox.GetTransparentProxy (); | ||
|
||
/* | ||
bus.NameAcquired += delegate (string name) { | ||
Console.WriteLine ("NameAcquired: " + name); | ||
}; | ||
*/ | ||
|
||
bus.NameAcquired += delegate (string acquired_name) { | ||
Console.WriteLine ("NameAcquired: " + acquired_name); | ||
}; | ||
|
||
string myName = bus.Hello (); | ||
Console.WriteLine ("myName: " + myName); | ||
|
||
//hack to process the NameAcquired signal synchronously | ||
conn.HandleMessage (conn.ReadMessage ()); | ||
|
||
string myNameReq = "org.ndesk.test"; | ||
|
||
//NameReply nameReply = bus.RequestName (myNameReq, NameFlag.None); | ||
NameReply nameReply = (NameReply)bus.RequestName (myNameReq, NameFlag.None); | ||
|
||
Console.WriteLine ("nameReply: " + nameReply); | ||
|
||
System.Threading.Thread.Sleep (60000); | ||
} | ||
} |