From 05f82f95b48b0c9d340c3751fc4b89232b60dd70 Mon Sep 17 00:00:00 2001 From: Rodrigo Moya Date: Sun, 9 Feb 2003 01:27:23 +0000 Subject: [PATCH] Updated example svn path=/trunk/gtk-sharp/; revision=11380 --- sample/DbClient/GnomeDbClient.cs | 15 ++++++++++----- 1 file changed, 10 insertions(+), 5 deletions(-) diff --git a/sample/DbClient/GnomeDbClient.cs b/sample/DbClient/GnomeDbClient.cs index d637eef40..59762a3b8 100644 --- a/sample/DbClient/GnomeDbClient.cs +++ b/sample/DbClient/GnomeDbClient.cs @@ -38,9 +38,13 @@ class GnomeDbClient { GnomeDb.Application.Run (); } - static void Client_Error (object o, ErrorArgs args) + static void Client_Event (object o, EventNotificationArgs args) { - System.Console.WriteLine ("There's been an error"); + switch (args.Event) { + case ClientEvent.Error : + System.Console.WriteLine ("There's been an error"); + break; + } } static void Window_Delete (object o, DeleteEventArgs args) @@ -49,7 +53,7 @@ class GnomeDbClient { args.RetVal = true; } - static void DB_connect (Gtk.Object o) + static void DB_connect () { GnomeDb.LoginDialog dialog; @@ -57,10 +61,11 @@ class GnomeDbClient { if (dialog.Run () == true) { if (client == null) { client = new Gda.Client (); - client.Error += new GdaSharp.ErrorHandler (Client_Error); + client.EventNotification += new GdaSharp.EventNotificationHandler (Client_Event); } - cnc = client.OpenConnection (dialog.Dsn, dialog.Username, dialog.Password); + cnc = client.OpenConnection (dialog.Dsn, dialog.Username, dialog.Password, + Gda.ConnectionOptions.Only); if (cnc != null) browser.Connection = cnc; }