dbus/mono/example EchoClient.cs, NONE, 1.1 EchoServer.cs, NONE, 1.1 Echoer.cs, NONE, 1.1 Makefile.am, NONE, 1.1

Owen Fraser-Green ow3n at pdx.freedesktop.org
Tue Mar 23 04:10:34 PST 2004


Update of /cvs/dbus/dbus/mono/example
In directory pdx:/tmp/cvs-serv17190/mono/example

Added Files:
	EchoClient.cs EchoServer.cs Echoer.cs Makefile.am 
Log Message:
First checkin of the Mono bindings.


--- NEW FILE: EchoClient.cs ---
namespace Foo
{
  using System;
  using DBus;

  public class EchoClient
  {
    public static int Main(string [] args)
    {
      Connection connection = Bus.GetSessionBus();
      Service service = Service.Get(connection, "org.freedesktop.Test");
      Echoer echoer = (Echoer) 
	service.GetObject(typeof(Echoer), "/org/freedesktop/Test/Echoer");
      System.Console.WriteLine(echoer.Echo("Hello world!"));
      
      return 0;
    }
  }
}

--- NEW FILE: EchoServer.cs ---
namespace Foo
{
  using System;
  using DBus;
  using Gtk;

  public class EchoServer
  {
    public static int Main(string [] args)
    {
      Application.Init();
      
      Connection connection = Bus.GetSessionBus();
      Service service = new Service(connection, "org.freedesktop.Test");
      Echoer echoer = new Echoer();
      service.RegisterObject(echoer, "/org/freedesktop/Test/Echoer");
      
      Application.Run();
      
      return 0;
    }
  }
}

--- NEW FILE: Echoer.cs ---
namespace Foo
{
  using System;
  using DBus;

  [Interface("org.freedesktop.Test.Echoer")]
  public class Echoer
  {
    [Method]
    public virtual string Echo(string message)
    {
      System.Console.WriteLine("I received: " + message);
      return "Reply: " + message;
    }
  }
}

--- NEW FILE: Makefile.am ---
DESTDIR=

NOINST_EXES=echo-server.exe echo-client.exe

all: $(NOINST_EXES)

echo-server.exe: EchoServer.cs Echoer.cs
	$(MCS) $(MCSFLAGS) --unsafe --target exe -L .. -r dbus-sharp.dll -r gtk-sharp -o echo-server.exe EchoServer.cs Echoer.cs

echo-client.exe: EchoClient.cs Echoer.cs
	$(MCS) $(MCSFLAGS) --unsafe --target exe -L .. -r dbus-sharp.dll -o echo-client.exe EchoClient.cs Echoer.cs

clean:
	rm -f $(NOINST_EXES)

install: all

EXTRA_DIST=EchoServer.cs EchoClient.cs Echoer.cs





More information about the dbus-commit mailing list