>From 119f638fe61b134543bc5d8138841591ac6daeab Mon Sep 17 00:00:00 2001
From: Arnaud <arnaud.champion@devatom.fr>
Date: Wed, 27 Oct 2010 17:58:08 +0200
Subject: [PATCH] Add new sample for Visual Studio and Mono : virEventRegisterImpl

---
 Types.cs                                           |    6 +-
 .../MonoDevelop/virConnectOpenAuth/MainWindow.cs   |    1 +
 .../virEventRegisterImpl/AssemblyInfo.cs           |   27 +++
 examples/MonoDevelop/virEventRegisterImpl/Main.cs  |   17 ++
 .../MonoDevelop/virEventRegisterImpl/MainWindow.cs |  228 +++++++++++++++++++
 .../virEventRegisterImpl/gtk-gui/MainWindow.cs     |   91 ++++++++
 .../virEventRegisterImpl/gtk-gui/generated.cs      |   29 +++
 .../virEventRegisterImpl/gtk-gui/gui.stetic        |  123 ++++++++++
 .../virEventRegisterImpl.csproj                    |    1 +
 .../virEventRegisterImpl/Form1.Designer.cs         |   98 ++++++++
 .../VisualStudio/virEventRegisterImpl/Form1.cs     |  238 ++++++++++++++++++++
 .../VisualStudio/virEventRegisterImpl/Form1.resx   |  120 ++++++++++
 .../VisualStudio/virEventRegisterImpl/Program.cs   |   21 ++
 .../Properties/AssemblyInfo.cs                     |   36 +++
 .../Properties/Resources.Designer.cs               |   71 ++++++
 .../virEventRegisterImpl/Properties/Resources.resx |  117 ++++++++++
 .../Properties/Settings.Designer.cs                |   30 +++
 .../Properties/Settings.settings                   |    7 +
 .../virEventRegisterImpl.csproj                    |   93 ++++++++
 projects/MonoDevelop/LibvirtBindings.sln           |    9 +-
 projects/VisualStudio/LibvirtBindings.sln          |   13 +
 21 files changed, 1372 insertions(+), 4 deletions(-)
 create mode 100644 examples/MonoDevelop/virEventRegisterImpl/AssemblyInfo.cs
 create mode 100644 examples/MonoDevelop/virEventRegisterImpl/Main.cs
 create mode 100644 examples/MonoDevelop/virEventRegisterImpl/MainWindow.cs
 create mode 100644 examples/MonoDevelop/virEventRegisterImpl/gtk-gui/MainWindow.cs
 create mode 100644 examples/MonoDevelop/virEventRegisterImpl/gtk-gui/generated.cs
 create mode 100644 examples/MonoDevelop/virEventRegisterImpl/gtk-gui/gui.stetic
 create mode 100644 examples/MonoDevelop/virEventRegisterImpl/virEventRegisterImpl.csproj
 create mode 100644 examples/VisualStudio/virEventRegisterImpl/Form1.Designer.cs
 create mode 100644 examples/VisualStudio/virEventRegisterImpl/Form1.cs
 create mode 100644 examples/VisualStudio/virEventRegisterImpl/Form1.resx
 create mode 100644 examples/VisualStudio/virEventRegisterImpl/Program.cs
 create mode 100644 examples/VisualStudio/virEventRegisterImpl/Properties/AssemblyInfo.cs
 create mode 100644 examples/VisualStudio/virEventRegisterImpl/Properties/Resources.Designer.cs
 create mode 100644 examples/VisualStudio/virEventRegisterImpl/Properties/Resources.resx
 create mode 100644 examples/VisualStudio/virEventRegisterImpl/Properties/Settings.Designer.cs
 create mode 100644 examples/VisualStudio/virEventRegisterImpl/Properties/Settings.settings
 create mode 100644 examples/VisualStudio/virEventRegisterImpl/virEventRegisterImpl.csproj

diff --git a/Types.cs b/Types.cs
index 4609b6c..d45db75 100644
--- a/Types.cs
+++ b/Types.cs
@@ -32,7 +32,7 @@ namespace Libvirt
     /// <param name="detail">event specific detail information</param>
     /// <param name="opaque">opaque user data</param>
     [UnmanagedFunctionPointer(CallingConvention.Cdecl)]
-    public delegate void ConnectDomainEventCallback(IntPtr conn, IntPtr dom, DomainEventType evt, int detail, IntPtr opaque);
+    public delegate void ConnectDomainEventCallback(IntPtr conn, IntPtr dom, [MarshalAs(UnmanagedType.I4)] DomainEventType evt, int detail, IntPtr opaque);
     ///<summary>
     /// Callback for receiving file handle events. The callback will be invoked once for each event which is pending.
     ///</summary>
@@ -58,7 +58,7 @@ namespace Libvirt
     ///<param name="ff">the callback invoked to free opaque data blob</param>
     ///<returns>a handle watch number to be used for updating and unregistering for events</returns>
     [UnmanagedFunctionPointer(CallingConvention.Cdecl)]
-    public delegate int EventAddHandleFunc(int fd, int events, EventHandleCallback cb, IntPtr opaque, FreeCallback ff);
+    public delegate int EventAddHandleFunc(int fd, int events, [MarshalAs(UnmanagedType.FunctionPtr)] EventHandleCallback cb, IntPtr opaque, [MarshalAs(UnmanagedType.FunctionPtr)] FreeCallback ff);
     ///<summary>
     /// Part of the EventImpl, this user-provided callback is notified when events to listen on change
     ///</summary>
@@ -88,7 +88,7 @@ namespace Libvirt
     ///<param name="ff">the callback invoked to free opaque data blob</param>
     /// <returns>A timer value</returns>
     [UnmanagedFunctionPointer(CallingConvention.Cdecl)]
-    public delegate int EventAddTimeoutFunc(int timeout, EventTimeoutCallback cb, IntPtr opaque, FreeCallback ff);
+    public delegate int EventAddTimeoutFunc(int timeout, [MarshalAs(UnmanagedType.FunctionPtr)] EventTimeoutCallback cb, IntPtr opaque, [MarshalAs(UnmanagedType.FunctionPtr)] FreeCallback ff);
     ///<summary>
     /// Part of the EventImpl, this user-defined callback updates an event timeout.
     ///</summary>
diff --git a/examples/MonoDevelop/virConnectOpenAuth/MainWindow.cs b/examples/MonoDevelop/virConnectOpenAuth/MainWindow.cs
index 0b8bbf8..ebccb11 100644
--- a/examples/MonoDevelop/virConnectOpenAuth/MainWindow.cs
+++ b/examples/MonoDevelop/virConnectOpenAuth/MainWindow.cs
@@ -139,6 +139,7 @@ public partial class MainWindow : Gtk.Window
         AuthData authData = (AuthData)Marshal.PtrToStructure(cbdata, typeof(AuthData));
         for (int i = 0; i < creds.Length; i++)
         {
+			ConnectCredential cred = creds[i];
             switch (cred.type)
             {
                 case ConnectCredentialType.VIR_CRED_AUTHNAME:
diff --git a/examples/MonoDevelop/virEventRegisterImpl/AssemblyInfo.cs b/examples/MonoDevelop/virEventRegisterImpl/AssemblyInfo.cs
new file mode 100644
index 0000000..fc62f6c
--- /dev/null
+++ b/examples/MonoDevelop/virEventRegisterImpl/AssemblyInfo.cs
@@ -0,0 +1,27 @@
+using System.Reflection;
+using System.Runtime.CompilerServices;
+
+// Information about this assembly is defined by the following attributes. 
+// Change them to the values specific to your project.
+
+[assembly: AssemblyTitle("virEventRegisterImpl")]
+[assembly: AssemblyDescription("")]
+[assembly: AssemblyConfiguration("")]
+[assembly: AssemblyCompany("")]
+[assembly: AssemblyProduct("")]
+[assembly: AssemblyCopyright("")]
+[assembly: AssemblyTrademark("")]
+[assembly: AssemblyCulture("")]
+
+// The assembly version has the format "{Major}.{Minor}.{Build}.{Revision}".
+// The form "{Major}.{Minor}.*" will automatically update the build and revision,
+// and "{Major}.{Minor}.{Build}.*" will update just the revision.
+
+[assembly: AssemblyVersion("1.0.*")]
+
+// The following attributes are used to specify the signing key for the assembly, 
+// if desired. See the Mono documentation for more information about signing.
+
+//[assembly: AssemblyDelaySign(false)]
+//[assembly: AssemblyKeyFile("")]
+
diff --git a/examples/MonoDevelop/virEventRegisterImpl/Main.cs b/examples/MonoDevelop/virEventRegisterImpl/Main.cs
new file mode 100644
index 0000000..66c083a
--- /dev/null
+++ b/examples/MonoDevelop/virEventRegisterImpl/Main.cs
@@ -0,0 +1,17 @@
+using System;
+using Gtk;
+
+namespace virEventRegisterImpl
+{
+	class MainClass
+	{
+		public static void Main (string[] args)
+		{
+			Application.Init ();
+			MainWindow win = new MainWindow ();
+			win.Show ();
+			Application.Run ();
+		}
+	}
+}
+
diff --git a/examples/MonoDevelop/virEventRegisterImpl/MainWindow.cs b/examples/MonoDevelop/virEventRegisterImpl/MainWindow.cs
new file mode 100644
index 0000000..4a83a50
--- /dev/null
+++ b/examples/MonoDevelop/virEventRegisterImpl/MainWindow.cs
@@ -0,0 +1,228 @@
+/*
+ * Copyright (C)
+ *   Arnaud Champion <arnaud.champion@devatom.fr>
+ *   Jaromír Červenka <cervajz@cervajz.com>
+ *
+ * See COPYING.LIB for the License of this software
+ * 
+ * Sample code for :
+ * Function :
+ *      Connect.DomainEventRegister
+ *      Connect.OpenAuth
+ *      Event.RegisterImpl
+ *      
+ *
+ * Types :
+ *      EventHandleType
+ *      EventHandleCallback
+ *      FreeCallback
+ *      EventTimeoutCallback
+ *      DomainEventType
+ *      DomainEventDefinedDetailType
+ *      DomainEventUndefinedDetailType
+ *      DomainEventResumedDetailType
+ *      DomainEventStartedDetailType
+ *      DomainEventStoppedDetailType
+ *      DomainEventSuspendedDetailType
+ *      
+ */
+
+using System;
+using Gtk;
+using Libvirt;
+
+public partial class MainWindow : Gtk.Window
+{
+	private int _fd;
+    private EventHandleType _event;
+    private EventHandleCallback _cb;
+    private FreeCallback _ff;
+    private IntPtr _opaque;
+    private int _active;
+    private int _timeout;
+    private EventTimeoutCallback _tcb;
+    private IntPtr _conn;
+	private TextBuffer _textBuf;
+	
+	public MainWindow () : base(Gtk.WindowType.Toplevel)
+	{
+		Build ();
+		GLib.Timeout.Add(50, new GLib.TimeoutHandler(TimerCallback));
+		_textBuf = textview1.Buffer;
+		Event.RegisterImpl(AddHandleFunc, UpdateHandleFunc, RemoveHandleFunc, AddTimeoutFunc, UpdateTimeoutFunc,
+                               RemoveTimeoutFunc);
+	}
+
+	private bool TimerCallback()
+    {
+        if (_tcb != null && _active == 1)
+            _tcb(_timeout, _opaque);
+
+        if (_cb != null)
+        {
+            _cb(0,
+                 _fd,
+                 (int)_event,
+                 _opaque);
+        }
+		
+		return true;
+    }
+	
+	private void FreeFunc(IntPtr opaque)
+        {
+        }
+
+        private int RemoveTimeoutFunc(int timer)
+        {
+            _active = 0;
+            if (_ff != null)
+                _ff(_opaque);
+            return 0;
+        }
+
+        private void UpdateTimeoutFunc(int timer, int timeout)
+        {
+            _timeout = timeout;
+        }
+
+        private int AddTimeoutFunc(int timeout, EventTimeoutCallback cb, IntPtr opaque, FreeCallback ff)
+        {
+            _active = 1;
+            _timeout = timeout;
+            _tcb = cb;
+            _ff = ff;
+            _opaque = opaque;
+            return 0;
+        }
+
+        private int RemoveHandleFunc(int watch)
+        {
+            _fd = 0;
+            if (_ff != null)
+                _ff(_opaque);
+            return 0;
+        }
+        private void UpdateHandleFunc(int watch, int events)
+        {
+            _event = (EventHandleType)events;
+        }
+
+        private int AddHandleFunc(int fd, int events, EventHandleCallback cb, IntPtr opaque, FreeCallback ff)
+        {
+            _fd = fd;
+            _event = (EventHandleType)events;
+            _cb = cb;
+            _ff = ff;
+            _opaque = opaque;
+            return 0;
+        }
+	
+	protected void OnDeleteEvent (object sender, DeleteEventArgs a)
+	{
+		Application.Quit ();
+		a.RetVal = true;
+	}
+	
+	protected virtual void OnButton1Clicked (object sender, System.EventArgs e)
+	{
+		_conn = Connect.Open(entry1.Text);
+        int cbInstall = Connect.DomainEventRegister(_conn, DomainEventCallback, IntPtr.Zero, FreeFunc);
+        if (cbInstall == 0)
+        {
+			_textBuf.Text = "Connection Done.\r\n";
+        }
+	}
+	
+	private void DomainEventCallback(IntPtr conn, IntPtr dom, DomainEventType evt, int detail, IntPtr opaque)
+    {
+        switch (evt)
+        {
+            case DomainEventType.VIR_DOMAIN_EVENT_DEFINED:
+				_textBuf.Text += "Domain defined :";
+                switch ((DomainEventDefinedDetailType)detail)
+                {
+                    case DomainEventDefinedDetailType.VIR_DOMAIN_EVENT_DEFINED_ADDED:
+						_textBuf.Text += "domain added\r\n";
+                        break;
+                    case DomainEventDefinedDetailType.VIR_DOMAIN_EVENT_DEFINED_UPDATED:
+						_textBuf.Text += "domain updated\r\n";
+                        break;
+                }
+                break;
+            case DomainEventType.VIR_DOMAIN_EVENT_UNDEFINED:
+				_textBuf.Text += "Domain undefined :";
+                switch ((DomainEventUndefinedDetailType)detail)
+                {
+                    case DomainEventUndefinedDetailType.VIR_DOMAIN_EVENT_UNDEFINED_REMOVED:
+						_textBuf.Text += "domain removeed\r\n";
+                        break;
+                }
+                break;
+            case DomainEventType.VIR_DOMAIN_EVENT_RESUMED:
+				_textBuf.Text += "Domain resumed :";
+                switch ((DomainEventResumedDetailType)detail)
+                {
+                    case DomainEventResumedDetailType.VIR_DOMAIN_EVENT_RESUMED_MIGRATED:
+						_textBuf.Text += "domain migrated\r\n";
+                        break;
+                    case DomainEventResumedDetailType.VIR_DOMAIN_EVENT_RESUMED_UNPAUSED:
+						_textBuf.Text += "domain unpaused\r\n";
+                        break;
+                }
+                break;
+            case DomainEventType.VIR_DOMAIN_EVENT_STARTED:
+				_textBuf.Text += "Domain started :";
+                switch ((DomainEventStartedDetailType)detail)
+                {
+                    case DomainEventStartedDetailType.VIR_DOMAIN_EVENT_STARTED_BOOTED:
+						_textBuf.Text += "domain booted\r\n";
+                        break;
+                    case DomainEventStartedDetailType.VIR_DOMAIN_EVENT_STARTED_MIGRATED:
+						_textBuf.Text += "domain migrated\r\n";
+                        break;
+                    case DomainEventStartedDetailType.VIR_DOMAIN_EVENT_STARTED_RESTORED:
+						_textBuf.Text += "domain restored\r\n";
+                        break;
+                }
+                break;
+            case DomainEventType.VIR_DOMAIN_EVENT_STOPPED:
+				_textBuf.Text += "Domain stopped :";
+                switch ((DomainEventStoppedDetailType)detail)
+                {
+                    case DomainEventStoppedDetailType.VIR_DOMAIN_EVENT_STOPPED_CRASHED:
+						_textBuf.Text += "domain crashed\r\n";
+                        break;
+                    case DomainEventStoppedDetailType.VIR_DOMAIN_EVENT_STOPPED_DESTROYED:
+						_textBuf.Text += "domain destroyed\r\n";
+                        break;
+                    case DomainEventStoppedDetailType.VIR_DOMAIN_EVENT_STOPPED_FAILED:
+						_textBuf.Text += "domain failed\r\n";
+                        break;
+                    case DomainEventStoppedDetailType.VIR_DOMAIN_EVENT_STOPPED_MIGRATED:
+						_textBuf.Text += "domain migrated\r\n";
+                        break;
+                    case DomainEventStoppedDetailType.VIR_DOMAIN_EVENT_STOPPED_SAVED:
+						_textBuf.Text += "domain saved\r\n";
+                        break;
+                    case DomainEventStoppedDetailType.VIR_DOMAIN_EVENT_STOPPED_SHUTDOWN:
+						_textBuf.Text += "domain shutdown\r\n";
+                        break;
+                }
+                break;
+            case DomainEventType.VIR_DOMAIN_EVENT_SUSPENDED:
+				_textBuf.Text += "Domain suspended :";
+                switch ((DomainEventSuspendedDetailType)detail)
+                {
+                    case DomainEventSuspendedDetailType.VIR_DOMAIN_EVENT_SUSPENDED_MIGRATED:
+						_textBuf.Text += "domain migrated\r\n";
+                        break;
+                    case DomainEventSuspendedDetailType.VIR_DOMAIN_EVENT_SUSPENDED_PAUSED:
+						_textBuf.Text += "domain paused\r\n";
+                        break;
+                }
+                break;
+        }
+    }
+}
+
diff --git a/examples/MonoDevelop/virEventRegisterImpl/gtk-gui/MainWindow.cs b/examples/MonoDevelop/virEventRegisterImpl/gtk-gui/MainWindow.cs
new file mode 100644
index 0000000..96432ba
--- /dev/null
+++ b/examples/MonoDevelop/virEventRegisterImpl/gtk-gui/MainWindow.cs
@@ -0,0 +1,91 @@
+
+// This file has been generated by the GUI designer. Do not modify.
+
+public partial class MainWindow
+{
+	private global::Gtk.Table table1;
+
+	private global::Gtk.Button button1;
+
+	private global::Gtk.Entry entry1;
+
+	private global::Gtk.ScrolledWindow GtkScrolledWindow;
+
+	private global::Gtk.TextView textview1;
+
+	private global::Gtk.Label label1;
+
+	protected virtual void Build ()
+	{
+		global::Stetic.Gui.Initialize (this);
+		// Widget MainWindow
+		this.Name = "MainWindow";
+		this.Title = global::Mono.Unix.Catalog.GetString ("MainWindow");
+		this.WindowPosition = ((global::Gtk.WindowPosition)(4));
+		// Container child MainWindow.Gtk.Container+ContainerChild
+		this.table1 = new global::Gtk.Table (((uint)(3)), ((uint)(2)), false);
+		this.table1.Name = "table1";
+		this.table1.RowSpacing = ((uint)(6));
+		this.table1.ColumnSpacing = ((uint)(6));
+		// Container child table1.Gtk.Table+TableChild
+		this.button1 = new global::Gtk.Button ();
+		this.button1.CanFocus = true;
+		this.button1.Name = "button1";
+		this.button1.UseUnderline = true;
+		this.button1.Label = global::Mono.Unix.Catalog.GetString ("Connect");
+		this.table1.Add (this.button1);
+		global::Gtk.Table.TableChild w1 = ((global::Gtk.Table.TableChild)(this.table1[this.button1]));
+		w1.TopAttach = ((uint)(1));
+		w1.BottomAttach = ((uint)(2));
+		w1.LeftAttach = ((uint)(1));
+		w1.RightAttach = ((uint)(2));
+		w1.XOptions = ((global::Gtk.AttachOptions)(4));
+		w1.YOptions = ((global::Gtk.AttachOptions)(4));
+		// Container child table1.Gtk.Table+TableChild
+		this.entry1 = new global::Gtk.Entry ();
+		this.entry1.CanFocus = true;
+		this.entry1.Name = "entry1";
+		this.entry1.Text = global::Mono.Unix.Catalog.GetString ("qemu+tcp://192.168.220.198/session");
+		this.entry1.IsEditable = true;
+		this.table1.Add (this.entry1);
+		global::Gtk.Table.TableChild w2 = ((global::Gtk.Table.TableChild)(this.table1[this.entry1]));
+		w2.LeftAttach = ((uint)(1));
+		w2.RightAttach = ((uint)(2));
+		w2.XOptions = ((global::Gtk.AttachOptions)(4));
+		w2.YOptions = ((global::Gtk.AttachOptions)(4));
+		// Container child table1.Gtk.Table+TableChild
+		this.GtkScrolledWindow = new global::Gtk.ScrolledWindow ();
+		this.GtkScrolledWindow.Name = "GtkScrolledWindow";
+		this.GtkScrolledWindow.ShadowType = ((global::Gtk.ShadowType)(1));
+		// Container child GtkScrolledWindow.Gtk.Container+ContainerChild
+		this.textview1 = new global::Gtk.TextView ();
+		this.textview1.Buffer.Text = "test";
+		this.textview1.CanFocus = true;
+		this.textview1.Name = "textview1";
+		this.GtkScrolledWindow.Add (this.textview1);
+		this.table1.Add (this.GtkScrolledWindow);
+		global::Gtk.Table.TableChild w4 = ((global::Gtk.Table.TableChild)(this.table1[this.GtkScrolledWindow]));
+		w4.TopAttach = ((uint)(2));
+		w4.BottomAttach = ((uint)(3));
+		w4.LeftAttach = ((uint)(1));
+		w4.RightAttach = ((uint)(2));
+		w4.XOptions = ((global::Gtk.AttachOptions)(4));
+		// Container child table1.Gtk.Table+TableChild
+		this.label1 = new global::Gtk.Label ();
+		this.label1.Name = "label1";
+		this.label1.LabelProp = global::Mono.Unix.Catalog.GetString ("URI :");
+		this.table1.Add (this.label1);
+		global::Gtk.Table.TableChild w5 = ((global::Gtk.Table.TableChild)(this.table1[this.label1]));
+		w5.XOptions = ((global::Gtk.AttachOptions)(4));
+		w5.YOptions = ((global::Gtk.AttachOptions)(4));
+		this.Add (this.table1);
+		if ((this.Child != null)) {
+			this.Child.ShowAll ();
+		}
+		this.DefaultWidth = 208;
+		this.DefaultHeight = 300;
+		this.Show ();
+		this.DeleteEvent += new global::Gtk.DeleteEventHandler (this.OnDeleteEvent);
+		this.button1.Clicked += new global::System.EventHandler (this.OnButton1Clicked);
+	}
+}
diff --git a/examples/MonoDevelop/virEventRegisterImpl/gtk-gui/generated.cs b/examples/MonoDevelop/virEventRegisterImpl/gtk-gui/generated.cs
new file mode 100644
index 0000000..8463caa
--- /dev/null
+++ b/examples/MonoDevelop/virEventRegisterImpl/gtk-gui/generated.cs
@@ -0,0 +1,29 @@
+
+// This file has been generated by the GUI designer. Do not modify.
+namespace Stetic
+{
+	internal class Gui
+	{
+		private static bool initialized;
+
+		static internal void Initialize (Gtk.Widget iconRenderer)
+		{
+			if ((Stetic.Gui.initialized == false)) {
+				Stetic.Gui.initialized = true;
+			}
+		}
+	}
+
+	internal class ActionGroups
+	{
+		public static Gtk.ActionGroup GetActionGroup (System.Type type)
+		{
+			return Stetic.ActionGroups.GetActionGroup (type.FullName);
+		}
+
+		public static Gtk.ActionGroup GetActionGroup (string name)
+		{
+			return null;
+		}
+	}
+}
diff --git a/examples/MonoDevelop/virEventRegisterImpl/gtk-gui/gui.stetic b/examples/MonoDevelop/virEventRegisterImpl/gtk-gui/gui.stetic
new file mode 100644
index 0000000..e894f20
--- /dev/null
+++ b/examples/MonoDevelop/virEventRegisterImpl/gtk-gui/gui.stetic
@@ -0,0 +1,123 @@
+﻿<?xml version="1.0" encoding="utf-8"?>
+<stetic-interface>
+  <configuration>
+    <images-root-path>..</images-root-path>
+    <target-gtk-version>2.12</target-gtk-version>
+  </configuration>
+  <import>
+    <widget-library name="glade-sharp, Version=2.12.0.0, Culture=neutral, PublicKeyToken=35e10195dab3c99f" />
+    <widget-library name="..\bin\Debug\virEventRegisterImpl.exe" internal="true" />
+  </import>
+  <widget class="Gtk.Window" id="MainWindow" design-size="208 300">
+    <property name="MemberName" />
+    <property name="Title" translatable="yes">MainWindow</property>
+    <property name="WindowPosition">CenterOnParent</property>
+    <signal name="DeleteEvent" handler="OnDeleteEvent" />
+    <child>
+      <widget class="Gtk.Table" id="table1">
+        <property name="MemberName" />
+        <property name="NRows">3</property>
+        <property name="NColumns">2</property>
+        <property name="RowSpacing">6</property>
+        <property name="ColumnSpacing">6</property>
+        <child>
+          <placeholder />
+        </child>
+        <child>
+          <placeholder />
+        </child>
+        <child>
+          <widget class="Gtk.Button" id="button1">
+            <property name="MemberName" />
+            <property name="CanFocus">True</property>
+            <property name="Type">TextOnly</property>
+            <property name="Label" translatable="yes">Connect</property>
+            <property name="UseUnderline">True</property>
+            <signal name="Clicked" handler="OnButton1Clicked" />
+          </widget>
+          <packing>
+            <property name="TopAttach">1</property>
+            <property name="BottomAttach">2</property>
+            <property name="LeftAttach">1</property>
+            <property name="RightAttach">2</property>
+            <property name="AutoSize">True</property>
+            <property name="XOptions">Fill</property>
+            <property name="YOptions">Fill</property>
+            <property name="XExpand">False</property>
+            <property name="XFill">True</property>
+            <property name="XShrink">False</property>
+            <property name="YExpand">False</property>
+            <property name="YFill">True</property>
+            <property name="YShrink">False</property>
+          </packing>
+        </child>
+        <child>
+          <widget class="Gtk.Entry" id="entry1">
+            <property name="MemberName" />
+            <property name="CanFocus">True</property>
+            <property name="Text" translatable="yes">qemu+tcp://192.168.220.198/session</property>
+            <property name="IsEditable">True</property>
+          </widget>
+          <packing>
+            <property name="LeftAttach">1</property>
+            <property name="RightAttach">2</property>
+            <property name="AutoSize">True</property>
+            <property name="XOptions">Fill</property>
+            <property name="YOptions">Fill</property>
+            <property name="XExpand">False</property>
+            <property name="XFill">True</property>
+            <property name="XShrink">False</property>
+            <property name="YExpand">False</property>
+            <property name="YFill">True</property>
+            <property name="YShrink">False</property>
+          </packing>
+        </child>
+        <child>
+          <widget class="Gtk.ScrolledWindow" id="GtkScrolledWindow">
+            <property name="MemberName" />
+            <property name="ShadowType">In</property>
+            <child>
+              <widget class="Gtk.TextView" id="textview1">
+                <property name="MemberName" />
+                <property name="CanFocus">True</property>
+                <property name="ShowScrollbars">True</property>
+                <property name="Text" />
+              </widget>
+            </child>
+          </widget>
+          <packing>
+            <property name="TopAttach">2</property>
+            <property name="BottomAttach">3</property>
+            <property name="LeftAttach">1</property>
+            <property name="RightAttach">2</property>
+            <property name="AutoSize">True</property>
+            <property name="XOptions">Fill</property>
+            <property name="XExpand">False</property>
+            <property name="XFill">True</property>
+            <property name="XShrink">False</property>
+            <property name="YExpand">True</property>
+            <property name="YFill">True</property>
+            <property name="YShrink">False</property>
+          </packing>
+        </child>
+        <child>
+          <widget class="Gtk.Label" id="label1">
+            <property name="MemberName" />
+            <property name="LabelProp" translatable="yes">URI :</property>
+          </widget>
+          <packing>
+            <property name="AutoSize">True</property>
+            <property name="XOptions">Fill</property>
+            <property name="YOptions">Fill</property>
+            <property name="XExpand">False</property>
+            <property name="XFill">True</property>
+            <property name="XShrink">False</property>
+            <property name="YExpand">False</property>
+            <property name="YFill">True</property>
+            <property name="YShrink">False</property>
+          </packing>
+        </child>
+      </widget>
+    </child>
+  </widget>
+</stetic-interface>
\ No newline at end of file
diff --git a/examples/MonoDevelop/virEventRegisterImpl/virEventRegisterImpl.csproj b/examples/MonoDevelop/virEventRegisterImpl/virEventRegisterImpl.csproj
new file mode 100644
index 0000000..f6cbf5b
--- /dev/null
+++ b/examples/MonoDevelop/virEventRegisterImpl/virEventRegisterImpl.csproj
@@ -0,0 +1 @@
+<?xml version="1.0" encoding="utf-8"?>
<Project DefaultTargets="Build" ToolsVersion="3.5" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
  <PropertyGroup>
    <Configuration Condition=" '$(Configuration)' == '' ">Debug</Configuration>
    <Platform Condition=" '$(Platform)' == '' ">AnyCPU</Platform>
    <ProductVersion>9.0.21022</ProductVersion>
    <SchemaVersion>2.0</SchemaVersion>
    <ProjectGuid>{4576BB61-F143-4BC8-BD1D-D50F710CEA10}</ProjectGuid>
    <OutputType>WinExe</OutputType>
    <RootNamespace>virEventRegisterImpl</RootNamespace>
    <AssemblyName>virEventRegisterImpl</AssemblyName>
    <TargetFrameworkVersion>v3.5</TargetFrameworkVersion>
  </PropertyGroup>
  <PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Debug|AnyCPU' ">
    <DebugSymbols>true</DebugSymbols>
    <DebugType>full</DebugType>
    <Optimize>false</Optimize>
    <OutputPath>bin\Debug</OutputPath>
    <DefineConstants>DEBUG</DefineConstants>
    <ErrorReport>prompt</ErrorReport>
    <WarningLevel>4</WarningLevel>
    <ConsolePause>false</ConsolePause>
  </PropertyGroup>
  <PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Release|AnyCPU' ">
    <DebugType>none</DebugType>
    <Optimize>false</Optimize>
    <OutputPath>bin\Release</OutputPath>
    <ErrorReport>prompt</ErrorReport>
    <WarningLevel>4</WarningLevel>
    <ConsolePause>false</ConsolePause>
  </PropertyGroup>
  <ItemGroup>
    <Reference Include="System" />
    <Reference Include="Mono.Posix" />
    <Reference Include="gtk-sharp, Version=2.12.0.0, Culture=neutral, PublicKeyToken=35e10195dab3c99f" />
    <Reference Include="gdk-sharp, Version=2.12.0.0, Culture=neutral, PublicKeyToken=35e10195dab3c99f" />
    <Reference Include="glib-sharp, Version=2.12.0.0, Culture=neutral, PublicKeyToken=35e10195dab3c99f" />
    <Reference Include="glade-sharp, Version=2.12.0.0, Culture=neutral, PublicKeyToken=35e10195dab3c99f" />
    <Reference Include="pango-sharp, Version=2.12.0.0, Culture=neutral, PublicKeyToken=35e10195dab3c99f" />
    <Reference Include="atk-sharp, Version=2.12.0.0, Culture=neutral, PublicKeyToken=35e10195dab3c99f" />
  </ItemGroup>
  <ItemGroup>
    <EmbeddedResource Include="gtk-gui\gui.stetic">
      <LogicalName>gui.stetic</LogicalName>
    </EmbeddedResource>
  </ItemGroup>
  <ItemGroup>
    <Compile Include="gtk-gui\generated.cs" />
    <Compile Include="MainWindow.cs" />
    <Compile Include="gtk-gui\MainWindow.cs" />
    <Compile Include="Main.cs" />
    <Compile Include="AssemblyInfo.cs" />
  </ItemGroup>
  <ItemGroup>
    <ProjectReference Include="..\..\..\projects\MonoDevelop\LibvirtBindings.csproj">
      <Project>{C51C70EB-9040-4F8E-9A18-DF2A77D04A37}</Project>
      <Name>LibvirtBindings</Name>
    </ProjectReference>
  </ItemGroup>
  <Import Project="$(MSBuildBinPath)\Microsoft.CSharp.targets" />
</Project>
\ No newline at end of file
diff --git a/examples/VisualStudio/virEventRegisterImpl/Form1.Designer.cs b/examples/VisualStudio/virEventRegisterImpl/Form1.Designer.cs
new file mode 100644
index 0000000..8f431af
--- /dev/null
+++ b/examples/VisualStudio/virEventRegisterImpl/Form1.Designer.cs
@@ -0,0 +1,98 @@
+﻿namespace virEventRegisterImpl
+{
+    partial class Form1
+    {
+        /// <summary>
+        /// Variable nécessaire au concepteur.
+        /// </summary>
+        private System.ComponentModel.IContainer components = null;
+
+        /// <summary>
+        /// Nettoyage des ressources utilisées.
+        /// </summary>
+        /// <param name="disposing">true si les ressources managées doivent être supprimées ; sinon, false.</param>
+        protected override void Dispose(bool disposing)
+        {
+            if (disposing && (components != null))
+            {
+                components.Dispose();
+            }
+            base.Dispose(disposing);
+        }
+
+        #region Code généré par le Concepteur Windows Form
+
+        /// <summary>
+        /// Méthode requise pour la prise en charge du concepteur - ne modifiez pas
+        /// le contenu de cette méthode avec l'éditeur de code.
+        /// </summary>
+        private void InitializeComponent()
+        {
+            this.tbURI = new System.Windows.Forms.TextBox();
+            this.label1 = new System.Windows.Forms.Label();
+            this.btnConnect = new System.Windows.Forms.Button();
+            this.tbEvents = new System.Windows.Forms.TextBox();
+            this.SuspendLayout();
+            // 
+            // tbURI
+            // 
+            this.tbURI.Location = new System.Drawing.Point(50, 12);
+            this.tbURI.Name = "tbURI";
+            this.tbURI.Size = new System.Drawing.Size(222, 20);
+            this.tbURI.TabIndex = 0;
+            this.tbURI.Text = "qemu+tcp://192.168.220.198/session";
+            // 
+            // label1
+            // 
+            this.label1.AutoSize = true;
+            this.label1.Location = new System.Drawing.Point(12, 15);
+            this.label1.Name = "label1";
+            this.label1.Size = new System.Drawing.Size(32, 13);
+            this.label1.TabIndex = 1;
+            this.label1.Text = "URI :";
+            // 
+            // btnConnect
+            // 
+            this.btnConnect.Location = new System.Drawing.Point(197, 38);
+            this.btnConnect.Name = "btnConnect";
+            this.btnConnect.Size = new System.Drawing.Size(75, 23);
+            this.btnConnect.TabIndex = 2;
+            this.btnConnect.Text = "Connect";
+            this.btnConnect.UseVisualStyleBackColor = true;
+            this.btnConnect.Click += new System.EventHandler(this.btnConnect_Click);
+            // 
+            // tbEvents
+            // 
+            this.tbEvents.Location = new System.Drawing.Point(15, 67);
+            this.tbEvents.Multiline = true;
+            this.tbEvents.Name = "tbEvents";
+            this.tbEvents.ReadOnly = true;
+            this.tbEvents.Size = new System.Drawing.Size(257, 183);
+            this.tbEvents.TabIndex = 3;
+            // 
+            // Form1
+            // 
+            this.AutoScaleDimensions = new System.Drawing.SizeF(6F, 13F);
+            this.AutoScaleMode = System.Windows.Forms.AutoScaleMode.Font;
+            this.ClientSize = new System.Drawing.Size(284, 262);
+            this.Controls.Add(this.tbEvents);
+            this.Controls.Add(this.btnConnect);
+            this.Controls.Add(this.label1);
+            this.Controls.Add(this.tbURI);
+            this.Name = "Form1";
+            this.Text = "Form1";
+            this.Load += new System.EventHandler(this.Form1_Load);
+            this.ResumeLayout(false);
+            this.PerformLayout();
+
+        }
+
+        #endregion
+
+        private System.Windows.Forms.TextBox tbURI;
+        private System.Windows.Forms.Label label1;
+        private System.Windows.Forms.Button btnConnect;
+        private System.Windows.Forms.TextBox tbEvents;
+    }
+}
+
diff --git a/examples/VisualStudio/virEventRegisterImpl/Form1.cs b/examples/VisualStudio/virEventRegisterImpl/Form1.cs
new file mode 100644
index 0000000..3d9f9f5
--- /dev/null
+++ b/examples/VisualStudio/virEventRegisterImpl/Form1.cs
@@ -0,0 +1,238 @@
+﻿/*
+ * Copyright (C)
+ *   Arnaud Champion <arnaud.champion@devatom.fr>
+ *   Jaromír Červenka <cervajz@cervajz.com>
+ *
+ * See COPYING.LIB for the License of this software
+ * 
+ * Sample code for :
+ * Function :
+ *      Connect.DomainEventRegister
+ *      Connect.OpenAuth
+ *      Event.RegisterImpl
+ *      
+ *
+ * Types :
+ *      EventHandleType
+ *      EventHandleCallback
+ *      FreeCallback
+ *      EventTimeoutCallback
+ *      DomainEventType
+ *      DomainEventDefinedDetailType
+ *      DomainEventUndefinedDetailType
+ *      DomainEventResumedDetailType
+ *      DomainEventStartedDetailType
+ *      DomainEventStoppedDetailType
+ *      DomainEventSuspendedDetailType
+ *      
+ */
+
+using System;
+using System.Threading;
+using System.Windows.Forms;
+using Libvirt;
+
+namespace virEventRegisterImpl
+{
+    delegate void AddEventDelegate(string message);
+
+    public partial class Form1 : Form
+    {
+        private int _fd;
+        private EventHandleType _event;
+        private EventHandleCallback _cb;
+        private FreeCallback _ff;
+        private IntPtr _opaque;
+        private int _active;
+        private int _timeout;
+        private EventTimeoutCallback _tcb;
+        private IntPtr _conn;
+        private readonly System.Threading.Timer _callbackTimer;
+
+        public Form1()
+        {
+            InitializeComponent();
+            _callbackTimer = new System.Threading.Timer(TimerCallback, null, Timeout.Infinite, 50);
+        }
+
+        private void TimerCallback(object state)
+        {
+            if (_tcb != null && _active == 1)
+                _tcb(_timeout, _opaque);
+
+            if (_cb != null)
+            {
+                _cb(0,
+                     _fd,
+                     (int)_event,
+                     _opaque);
+            }
+        }
+
+        private void Form1_Load(object sender, EventArgs e)
+        {
+            Event.RegisterImpl(AddHandleFunc, UpdateHandleFunc, RemoveHandleFunc, AddTimeoutFunc, UpdateTimeoutFunc,
+                               RemoveTimeoutFunc);
+        }
+
+        private void FreeFunc(IntPtr opaque)
+        {
+        }
+
+        private int RemoveTimeoutFunc(int timer)
+        {
+            _active = 0;
+            if (_ff != null)
+                _ff(_opaque);
+            return 0;
+        }
+
+        private void UpdateTimeoutFunc(int timer, int timeout)
+        {
+            _timeout = timeout;
+        }
+
+        private int AddTimeoutFunc(int timeout, EventTimeoutCallback cb, IntPtr opaque, FreeCallback ff)
+        {
+            _active = 1;
+            _timeout = timeout;
+            _tcb = cb;
+            _ff = ff;
+            _opaque = opaque;
+            return 0;
+        }
+
+        private int RemoveHandleFunc(int watch)
+        {
+            _fd = 0;
+            if (_ff != null)
+                _ff(_opaque);
+            return 0;
+        }
+        private void UpdateHandleFunc(int watch, int events)
+        {
+            _event = (EventHandleType)events;
+        }
+
+        private int AddHandleFunc(int fd, int events, EventHandleCallback cb, IntPtr opaque, FreeCallback ff)
+        {
+            _fd = fd;
+            _event = (EventHandleType)events;
+            _cb = cb;
+            _ff = ff;
+            _opaque = opaque;
+            return 0;
+        }
+
+        private void btnConnect_Click(object sender, EventArgs e)
+        {
+            _conn = Connect.Open(tbURI.Text);
+            int cbInstall = Connect.DomainEventRegister(_conn, DomainEventCallback, IntPtr.Zero, FreeFunc);
+            if (cbInstall == 0)
+            {
+                tbEvents.Text = "Connection Done\r\n";
+                _callbackTimer.Change(0, 50);
+            }
+            else
+            {
+                MessageBox.Show("DomainEventRegister failed", "DomainEventRegister failed", MessageBoxButtons.OK, MessageBoxIcon.Error);
+            }
+        }
+
+        private void DomainEventCallback(IntPtr conn, IntPtr dom, DomainEventType evt, int detail, IntPtr opaque)
+        {
+            switch (evt)
+            {
+                case DomainEventType.VIR_DOMAIN_EVENT_DEFINED:
+                    BeginInvoke(new AddEventDelegate(AddEvent), new object[] {"Domain defined :"});
+                    switch ((DomainEventDefinedDetailType)detail)
+                    {
+                        case DomainEventDefinedDetailType.VIR_DOMAIN_EVENT_DEFINED_ADDED:
+                            BeginInvoke(new AddEventDelegate(AddEvent), new object[] { " domain added\r\n" });
+                            break;
+                        case DomainEventDefinedDetailType.VIR_DOMAIN_EVENT_DEFINED_UPDATED:
+                            BeginInvoke(new AddEventDelegate(AddEvent), new object[] { " domain updated\r\n" });
+                            break;
+                    }
+                    break;
+                case DomainEventType.VIR_DOMAIN_EVENT_UNDEFINED:
+                    BeginInvoke(new AddEventDelegate(AddEvent), new object[] { " domain undefined :" });
+                    switch ((DomainEventUndefinedDetailType)detail)
+                    {
+                        case DomainEventUndefinedDetailType.VIR_DOMAIN_EVENT_UNDEFINED_REMOVED:
+                            BeginInvoke(new AddEventDelegate(AddEvent), new object[] { " domain deleted\r\n" });
+                            break;
+                    }
+                    break;
+                case DomainEventType.VIR_DOMAIN_EVENT_RESUMED:
+                    BeginInvoke(new AddEventDelegate(AddEvent), new object[] { " domain resumed :" });
+                    switch ((DomainEventResumedDetailType)detail)
+                    {
+                        case DomainEventResumedDetailType.VIR_DOMAIN_EVENT_RESUMED_MIGRATED:
+                            BeginInvoke(new AddEventDelegate(AddEvent), new object[] { " domain migrated\r\n" });
+                            break;
+                        case DomainEventResumedDetailType.VIR_DOMAIN_EVENT_RESUMED_UNPAUSED:
+                            BeginInvoke(new AddEventDelegate(AddEvent), new object[] { " domain unpaused\r\n" });
+                            break;
+                    }
+                    break;
+                case DomainEventType.VIR_DOMAIN_EVENT_STARTED:
+                    BeginInvoke(new AddEventDelegate(AddEvent), new object[] { " domain started :" });
+                    switch ((DomainEventStartedDetailType)detail)
+                    {
+                        case DomainEventStartedDetailType.VIR_DOMAIN_EVENT_STARTED_BOOTED:
+                            BeginInvoke(new AddEventDelegate(AddEvent), new object[] { " domain booted\r\n" });
+                            break;
+                        case DomainEventStartedDetailType.VIR_DOMAIN_EVENT_STARTED_MIGRATED:
+                            BeginInvoke(new AddEventDelegate(AddEvent), new object[] { " domain migrated\r\n" });
+                            break;
+                        case DomainEventStartedDetailType.VIR_DOMAIN_EVENT_STARTED_RESTORED:
+                            BeginInvoke(new AddEventDelegate(AddEvent), new object[] { " domain restored\r\n" });
+                            break;
+                    }
+                    break;
+                case DomainEventType.VIR_DOMAIN_EVENT_STOPPED:
+                    BeginInvoke(new AddEventDelegate(AddEvent), new object[] { " domain stopped :" });
+                    switch ((DomainEventStoppedDetailType)detail)
+                    {
+                        case DomainEventStoppedDetailType.VIR_DOMAIN_EVENT_STOPPED_CRASHED:
+                            BeginInvoke(new AddEventDelegate(AddEvent), new object[] { " domain crashed\r\n" });
+                            break;
+                        case DomainEventStoppedDetailType.VIR_DOMAIN_EVENT_STOPPED_DESTROYED:
+                            BeginInvoke(new AddEventDelegate(AddEvent), new object[] { " domain destroyed\r\n" });
+                            break;
+                        case DomainEventStoppedDetailType.VIR_DOMAIN_EVENT_STOPPED_FAILED:
+                            BeginInvoke(new AddEventDelegate(AddEvent), new object[] { " domain failed\r\n" });
+                            break;
+                        case DomainEventStoppedDetailType.VIR_DOMAIN_EVENT_STOPPED_MIGRATED:
+                            BeginInvoke(new AddEventDelegate(AddEvent), new object[] { " domain migrated\r\n" });
+                            break;
+                        case DomainEventStoppedDetailType.VIR_DOMAIN_EVENT_STOPPED_SAVED:
+                            BeginInvoke(new AddEventDelegate(AddEvent), new object[] { " domain saved\r\n" });
+                            break;
+                        case DomainEventStoppedDetailType.VIR_DOMAIN_EVENT_STOPPED_SHUTDOWN:
+                            BeginInvoke(new AddEventDelegate(AddEvent), new object[] { " domain shutdown\r\n" });
+                            break;
+                    }
+                    break;
+                case DomainEventType.VIR_DOMAIN_EVENT_SUSPENDED:
+                    BeginInvoke(new AddEventDelegate(AddEvent), new object[] { " domain suspended :" });
+                    switch ((DomainEventSuspendedDetailType)detail)
+                    {
+                        case DomainEventSuspendedDetailType.VIR_DOMAIN_EVENT_SUSPENDED_MIGRATED:
+                            BeginInvoke(new AddEventDelegate(AddEvent), new object[] { " domain migrated\r\n" });
+                            break;
+                        case DomainEventSuspendedDetailType.VIR_DOMAIN_EVENT_SUSPENDED_PAUSED:
+                            BeginInvoke(new AddEventDelegate(AddEvent), new object[] { " domain paused\r\n" });
+                            break;
+                    }
+                    break;
+            }
+        }
+
+        private void AddEvent(string eventMessage)
+        {
+            tbEvents.Text += eventMessage;
+        }
+    }
+}
diff --git a/examples/VisualStudio/virEventRegisterImpl/Form1.resx b/examples/VisualStudio/virEventRegisterImpl/Form1.resx
new file mode 100644
index 0000000..1af7de1
--- /dev/null
+++ b/examples/VisualStudio/virEventRegisterImpl/Form1.resx
@@ -0,0 +1,120 @@
+﻿<?xml version="1.0" encoding="utf-8"?>
+<root>
+  <!-- 
+    Microsoft ResX Schema 
+    
+    Version 2.0
+    
+    The primary goals of this format is to allow a simple XML format 
+    that is mostly human readable. The generation and parsing of the 
+    various data types are done through the TypeConverter classes 
+    associated with the data types.
+    
+    Example:
+    
+    ... ado.net/XML headers & schema ...
+    <resheader name="resmimetype">text/microsoft-resx</resheader>
+    <resheader name="version">2.0</resheader>
+    <resheader name="reader">System.Resources.ResXResourceReader, System.Windows.Forms, ...</resheader>
+    <resheader name="writer">System.Resources.ResXResourceWriter, System.Windows.Forms, ...</resheader>
+    <data name="Name1"><value>this is my long string</value><comment>this is a comment</comment></data>
+    <data name="Color1" type="System.Drawing.Color, System.Drawing">Blue</data>
+    <data name="Bitmap1" mimetype="application/x-microsoft.net.object.binary.base64">
+        <value>[base64 mime encoded serialized .NET Framework object]</value>
+    </data>
+    <data name="Icon1" type="System.Drawing.Icon, System.Drawing" mimetype="application/x-microsoft.net.object.bytearray.base64">
+        <value>[base64 mime encoded string representing a byte array form of the .NET Framework object]</value>
+        <comment>This is a comment</comment>
+    </data>
+                
+    There are any number of "resheader" rows that contain simple 
+    name/value pairs.
+    
+    Each data row contains a name, and value. The row also contains a 
+    type or mimetype. Type corresponds to a .NET class that support 
+    text/value conversion through the TypeConverter architecture. 
+    Classes that don't support this are serialized and stored with the 
+    mimetype set.
+    
+    The mimetype is used for serialized objects, and tells the 
+    ResXResourceReader how to depersist the object. This is currently not 
+    extensible. For a given mimetype the value must be set accordingly:
+    
+    Note - application/x-microsoft.net.object.binary.base64 is the format 
+    that the ResXResourceWriter will generate, however the reader can 
+    read any of the formats listed below.
+    
+    mimetype: application/x-microsoft.net.object.binary.base64
+    value   : The object must be serialized with 
+            : System.Runtime.Serialization.Formatters.Binary.BinaryFormatter
+            : and then encoded with base64 encoding.
+    
+    mimetype: application/x-microsoft.net.object.soap.base64
+    value   : The object must be serialized with 
+            : System.Runtime.Serialization.Formatters.Soap.SoapFormatter
+            : and then encoded with base64 encoding.
+
+    mimetype: application/x-microsoft.net.object.bytearray.base64
+    value   : The object must be serialized into a byte array 
+            : using a System.ComponentModel.TypeConverter
+            : and then encoded with base64 encoding.
+    -->
+  <xsd:schema id="root" xmlns="" xmlns:xsd="http://www.w3.org/2001/XMLSchema" xmlns:msdata="urn:schemas-microsoft-com:xml-msdata">
+    <xsd:import namespace="http://www.w3.org/XML/1998/namespace" />
+    <xsd:element name="root" msdata:IsDataSet="true">
+      <xsd:complexType>
+        <xsd:choice maxOccurs="unbounded">
+          <xsd:element name="metadata">
+            <xsd:complexType>
+              <xsd:sequence>
+                <xsd:element name="value" type="xsd:string" minOccurs="0" />
+              </xsd:sequence>
+              <xsd:attribute name="name" use="required" type="xsd:string" />
+              <xsd:attribute name="type" type="xsd:string" />
+              <xsd:attribute name="mimetype" type="xsd:string" />
+              <xsd:attribute ref="xml:space" />
+            </xsd:complexType>
+          </xsd:element>
+          <xsd:element name="assembly">
+            <xsd:complexType>
+              <xsd:attribute name="alias" type="xsd:string" />
+              <xsd:attribute name="name" type="xsd:string" />
+            </xsd:complexType>
+          </xsd:element>
+          <xsd:element name="data">
+            <xsd:complexType>
+              <xsd:sequence>
+                <xsd:element name="value" type="xsd:string" minOccurs="0" msdata:Ordinal="1" />
+                <xsd:element name="comment" type="xsd:string" minOccurs="0" msdata:Ordinal="2" />
+              </xsd:sequence>
+              <xsd:attribute name="name" type="xsd:string" use="required" msdata:Ordinal="1" />
+              <xsd:attribute name="type" type="xsd:string" msdata:Ordinal="3" />
+              <xsd:attribute name="mimetype" type="xsd:string" msdata:Ordinal="4" />
+              <xsd:attribute ref="xml:space" />
+            </xsd:complexType>
+          </xsd:element>
+          <xsd:element name="resheader">
+            <xsd:complexType>
+              <xsd:sequence>
+                <xsd:element name="value" type="xsd:string" minOccurs="0" msdata:Ordinal="1" />
+              </xsd:sequence>
+              <xsd:attribute name="name" type="xsd:string" use="required" />
+            </xsd:complexType>
+          </xsd:element>
+        </xsd:choice>
+      </xsd:complexType>
+    </xsd:element>
+  </xsd:schema>
+  <resheader name="resmimetype">
+    <value>text/microsoft-resx</value>
+  </resheader>
+  <resheader name="version">
+    <value>2.0</value>
+  </resheader>
+  <resheader name="reader">
+    <value>System.Resources.ResXResourceReader, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089</value>
+  </resheader>
+  <resheader name="writer">
+    <value>System.Resources.ResXResourceWriter, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089</value>
+  </resheader>
+</root>
\ No newline at end of file
diff --git a/examples/VisualStudio/virEventRegisterImpl/Program.cs b/examples/VisualStudio/virEventRegisterImpl/Program.cs
new file mode 100644
index 0000000..f09c403
--- /dev/null
+++ b/examples/VisualStudio/virEventRegisterImpl/Program.cs
@@ -0,0 +1,21 @@
+﻿using System;
+using System.Collections.Generic;
+using System.Linq;
+using System.Windows.Forms;
+
+namespace virEventRegisterImpl
+{
+    static class Program
+    {
+        /// <summary>
+        /// Point d'entrée principal de l'application.
+        /// </summary>
+        [STAThread]
+        static void Main()
+        {
+            Application.EnableVisualStyles();
+            Application.SetCompatibleTextRenderingDefault(false);
+            Application.Run(new Form1());
+        }
+    }
+}
diff --git a/examples/VisualStudio/virEventRegisterImpl/Properties/AssemblyInfo.cs b/examples/VisualStudio/virEventRegisterImpl/Properties/AssemblyInfo.cs
new file mode 100644
index 0000000..bb951e0
--- /dev/null
+++ b/examples/VisualStudio/virEventRegisterImpl/Properties/AssemblyInfo.cs
@@ -0,0 +1,36 @@
+﻿using System.Reflection;
+using System.Runtime.CompilerServices;
+using System.Runtime.InteropServices;
+
+// Les informations générales relatives à un assembly dépendent de 
+// l'ensemble d'attributs suivant. Changez les valeurs de ces attributs pour modifier les informations
+// associées à un assembly.
+[assembly: AssemblyTitle("virEventRegisterImpl")]
+[assembly: AssemblyDescription("")]
+[assembly: AssemblyConfiguration("")]
+[assembly: AssemblyCompany("Microsoft")]
+[assembly: AssemblyProduct("virEventRegisterImpl")]
+[assembly: AssemblyCopyright("Copyright © Microsoft 2010")]
+[assembly: AssemblyTrademark("")]
+[assembly: AssemblyCulture("")]
+
+// L'affectation de la valeur false à ComVisible rend les types invisibles dans cet assembly 
+// aux composants COM. Si vous devez accéder à un type dans cet assembly à partir de 
+// COM, affectez la valeur true à l'attribut ComVisible sur ce type.
+[assembly: ComVisible(false)]
+
+// Le GUID suivant est pour l'ID de la typelib si ce projet est exposé à COM
+[assembly: Guid("0634d67c-a40d-4da7-9228-2d2950616998")]
+
+// Les informations de version pour un assembly se composent des quatre valeurs suivantes :
+//
+//      Version principale
+//      Version secondaire 
+//      Numéro de build
+//      Révision
+//
+// Vous pouvez spécifier toutes les valeurs ou indiquer les numéros de build et de révision par défaut 
+// en utilisant '*', comme indiqué ci-dessous :
+// [assembly: AssemblyVersion("1.0.*")]
+[assembly: AssemblyVersion("1.0.0.0")]
+[assembly: AssemblyFileVersion("1.0.0.0")]
diff --git a/examples/VisualStudio/virEventRegisterImpl/Properties/Resources.Designer.cs b/examples/VisualStudio/virEventRegisterImpl/Properties/Resources.Designer.cs
new file mode 100644
index 0000000..052a31d
--- /dev/null
+++ b/examples/VisualStudio/virEventRegisterImpl/Properties/Resources.Designer.cs
@@ -0,0 +1,71 @@
+﻿//------------------------------------------------------------------------------
+// <auto-generated>
+//     Ce code a été généré par un outil.
+//     Version du runtime :4.0.30319.1
+//
+//     Les modifications apportées à ce fichier peuvent provoquer un comportement incorrect et seront perdues si
+//     le code est régénéré.
+// </auto-generated>
+//------------------------------------------------------------------------------
+
+namespace virEventRegisterImpl.Properties
+{
+
+
+    /// <summary>
+    ///   Une classe de ressource fortement typée destinée, entre autres, à la consultation des chaînes localisées.
+    /// </summary>
+    // Cette classe a été générée automatiquement par la classe StronglyTypedResourceBuilder
+    // à l'aide d'un outil, tel que ResGen ou Visual Studio.
+    // Pour ajouter ou supprimer un membre, modifiez votre fichier .ResX, puis réexécutez ResGen
+    // avec l'option /str ou régénérez votre projet VS.
+    [global::System.CodeDom.Compiler.GeneratedCodeAttribute("System.Resources.Tools.StronglyTypedResourceBuilder", "4.0.0.0")]
+    [global::System.Diagnostics.DebuggerNonUserCodeAttribute()]
+    [global::System.Runtime.CompilerServices.CompilerGeneratedAttribute()]
+    internal class Resources
+    {
+
+        private static global::System.Resources.ResourceManager resourceMan;
+
+        private static global::System.Globalization.CultureInfo resourceCulture;
+
+        [global::System.Diagnostics.CodeAnalysis.SuppressMessageAttribute("Microsoft.Performance", "CA1811:AvoidUncalledPrivateCode")]
+        internal Resources()
+        {
+        }
+
+        /// <summary>
+        ///   Retourne l'instance ResourceManager mise en cache utilisée par cette classe.
+        /// </summary>
+        [global::System.ComponentModel.EditorBrowsableAttribute(global::System.ComponentModel.EditorBrowsableState.Advanced)]
+        internal static global::System.Resources.ResourceManager ResourceManager
+        {
+            get
+            {
+                if ((resourceMan == null))
+                {
+                    global::System.Resources.ResourceManager temp = new global::System.Resources.ResourceManager("virEventRegisterImpl.Properties.Resources", typeof(Resources).Assembly);
+                    resourceMan = temp;
+                }
+                return resourceMan;
+            }
+        }
+
+        /// <summary>
+        ///   Remplace la propriété CurrentUICulture du thread actuel pour toutes
+        ///   les recherches de ressources à l'aide de cette classe de ressource fortement typée.
+        /// </summary>
+        [global::System.ComponentModel.EditorBrowsableAttribute(global::System.ComponentModel.EditorBrowsableState.Advanced)]
+        internal static global::System.Globalization.CultureInfo Culture
+        {
+            get
+            {
+                return resourceCulture;
+            }
+            set
+            {
+                resourceCulture = value;
+            }
+        }
+    }
+}
diff --git a/examples/VisualStudio/virEventRegisterImpl/Properties/Resources.resx b/examples/VisualStudio/virEventRegisterImpl/Properties/Resources.resx
new file mode 100644
index 0000000..af7dbeb
--- /dev/null
+++ b/examples/VisualStudio/virEventRegisterImpl/Properties/Resources.resx
@@ -0,0 +1,117 @@
+﻿<?xml version="1.0" encoding="utf-8"?>
+<root>
+  <!-- 
+    Microsoft ResX Schema 
+    
+    Version 2.0
+    
+    The primary goals of this format is to allow a simple XML format 
+    that is mostly human readable. The generation and parsing of the 
+    various data types are done through the TypeConverter classes 
+    associated with the data types.
+    
+    Example:
+    
+    ... ado.net/XML headers & schema ...
+    <resheader name="resmimetype">text/microsoft-resx</resheader>
+    <resheader name="version">2.0</resheader>
+    <resheader name="reader">System.Resources.ResXResourceReader, System.Windows.Forms, ...</resheader>
+    <resheader name="writer">System.Resources.ResXResourceWriter, System.Windows.Forms, ...</resheader>
+    <data name="Name1"><value>this is my long string</value><comment>this is a comment</comment></data>
+    <data name="Color1" type="System.Drawing.Color, System.Drawing">Blue</data>
+    <data name="Bitmap1" mimetype="application/x-microsoft.net.object.binary.base64">
+        <value>[base64 mime encoded serialized .NET Framework object]</value>
+    </data>
+    <data name="Icon1" type="System.Drawing.Icon, System.Drawing" mimetype="application/x-microsoft.net.object.bytearray.base64">
+        <value>[base64 mime encoded string representing a byte array form of the .NET Framework object]</value>
+        <comment>This is a comment</comment>
+    </data>
+                
+    There are any number of "resheader" rows that contain simple 
+    name/value pairs.
+    
+    Each data row contains a name, and value. The row also contains a 
+    type or mimetype. Type corresponds to a .NET class that support 
+    text/value conversion through the TypeConverter architecture. 
+    Classes that don't support this are serialized and stored with the 
+    mimetype set.
+    
+    The mimetype is used for serialized objects, and tells the 
+    ResXResourceReader how to depersist the object. This is currently not 
+    extensible. For a given mimetype the value must be set accordingly:
+    
+    Note - application/x-microsoft.net.object.binary.base64 is the format 
+    that the ResXResourceWriter will generate, however the reader can 
+    read any of the formats listed below.
+    
+    mimetype: application/x-microsoft.net.object.binary.base64
+    value   : The object must be serialized with 
+            : System.Serialization.Formatters.Binary.BinaryFormatter
+            : and then encoded with base64 encoding.
+    
+    mimetype: application/x-microsoft.net.object.soap.base64
+    value   : The object must be serialized with 
+            : System.Runtime.Serialization.Formatters.Soap.SoapFormatter
+            : and then encoded with base64 encoding.
+
+    mimetype: application/x-microsoft.net.object.bytearray.base64
+    value   : The object must be serialized into a byte array 
+            : using a System.ComponentModel.TypeConverter
+            : and then encoded with base64 encoding.
+    -->
+  <xsd:schema id="root" xmlns="" xmlns:xsd="http://www.w3.org/2001/XMLSchema" xmlns:msdata="urn:schemas-microsoft-com:xml-msdata">
+    <xsd:element name="root" msdata:IsDataSet="true">
+      <xsd:complexType>
+        <xsd:choice maxOccurs="unbounded">
+          <xsd:element name="metadata">
+            <xsd:complexType>
+              <xsd:sequence>
+                <xsd:element name="value" type="xsd:string" minOccurs="0" />
+              </xsd:sequence>
+              <xsd:attribute name="name" type="xsd:string" />
+              <xsd:attribute name="type" type="xsd:string" />
+              <xsd:attribute name="mimetype" type="xsd:string" />
+            </xsd:complexType>
+          </xsd:element>
+          <xsd:element name="assembly">
+            <xsd:complexType>
+              <xsd:attribute name="alias" type="xsd:string" />
+              <xsd:attribute name="name" type="xsd:string" />
+            </xsd:complexType>
+          </xsd:element>
+          <xsd:element name="data">
+            <xsd:complexType>
+              <xsd:sequence>
+                <xsd:element name="value" type="xsd:string" minOccurs="0" msdata:Ordinal="1" />
+                <xsd:element name="comment" type="xsd:string" minOccurs="0" msdata:Ordinal="2" />
+              </xsd:sequence>
+              <xsd:attribute name="name" type="xsd:string" msdata:Ordinal="1" />
+              <xsd:attribute name="type" type="xsd:string" msdata:Ordinal="3" />
+              <xsd:attribute name="mimetype" type="xsd:string" msdata:Ordinal="4" />
+            </xsd:complexType>
+          </xsd:element>
+          <xsd:element name="resheader">
+            <xsd:complexType>
+              <xsd:sequence>
+                <xsd:element name="value" type="xsd:string" minOccurs="0" msdata:Ordinal="1" />
+              </xsd:sequence>
+              <xsd:attribute name="name" type="xsd:string" use="required" />
+            </xsd:complexType>
+          </xsd:element>
+        </xsd:choice>
+      </xsd:complexType>
+    </xsd:element>
+  </xsd:schema>
+  <resheader name="resmimetype">
+    <value>text/microsoft-resx</value>
+  </resheader>
+  <resheader name="version">
+    <value>2.0</value>
+  </resheader>
+  <resheader name="reader">
+    <value>System.Resources.ResXResourceReader, System.Windows.Forms, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089</value>
+  </resheader>
+  <resheader name="writer">
+    <value>System.Resources.ResXResourceWriter, System.Windows.Forms, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089</value>
+  </resheader>
+</root>
\ No newline at end of file
diff --git a/examples/VisualStudio/virEventRegisterImpl/Properties/Settings.Designer.cs b/examples/VisualStudio/virEventRegisterImpl/Properties/Settings.Designer.cs
new file mode 100644
index 0000000..397f126
--- /dev/null
+++ b/examples/VisualStudio/virEventRegisterImpl/Properties/Settings.Designer.cs
@@ -0,0 +1,30 @@
+﻿//------------------------------------------------------------------------------
+// <auto-generated>
+//     This code was generated by a tool.
+//     Runtime Version:4.0.30319.1
+//
+//     Changes to this file may cause incorrect behavior and will be lost if
+//     the code is regenerated.
+// </auto-generated>
+//------------------------------------------------------------------------------
+
+namespace virEventRegisterImpl.Properties
+{
+
+
+    [global::System.Runtime.CompilerServices.CompilerGeneratedAttribute()]
+    [global::System.CodeDom.Compiler.GeneratedCodeAttribute("Microsoft.VisualStudio.Editors.SettingsDesigner.SettingsSingleFileGenerator", "10.0.0.0")]
+    internal sealed partial class Settings : global::System.Configuration.ApplicationSettingsBase
+    {
+
+        private static Settings defaultInstance = ((Settings)(global::System.Configuration.ApplicationSettingsBase.Synchronized(new Settings())));
+
+        public static Settings Default
+        {
+            get
+            {
+                return defaultInstance;
+            }
+        }
+    }
+}
diff --git a/examples/VisualStudio/virEventRegisterImpl/Properties/Settings.settings b/examples/VisualStudio/virEventRegisterImpl/Properties/Settings.settings
new file mode 100644
index 0000000..3964565
--- /dev/null
+++ b/examples/VisualStudio/virEventRegisterImpl/Properties/Settings.settings
@@ -0,0 +1,7 @@
+﻿<?xml version='1.0' encoding='utf-8'?>
+<SettingsFile xmlns="http://schemas.microsoft.com/VisualStudio/2004/01/settings" CurrentProfile="(Default)">
+  <Profiles>
+    <Profile Name="(Default)" />
+  </Profiles>
+  <Settings />
+</SettingsFile>
diff --git a/examples/VisualStudio/virEventRegisterImpl/virEventRegisterImpl.csproj b/examples/VisualStudio/virEventRegisterImpl/virEventRegisterImpl.csproj
new file mode 100644
index 0000000..6a57c32
--- /dev/null
+++ b/examples/VisualStudio/virEventRegisterImpl/virEventRegisterImpl.csproj
@@ -0,0 +1,93 @@
+﻿<?xml version="1.0" encoding="utf-8"?>
+<Project ToolsVersion="4.0" DefaultTargets="Build" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
+  <PropertyGroup>
+    <Configuration Condition=" '$(Configuration)' == '' ">Debug</Configuration>
+    <Platform Condition=" '$(Platform)' == '' ">x86</Platform>
+    <ProductVersion>8.0.30703</ProductVersion>
+    <SchemaVersion>2.0</SchemaVersion>
+    <ProjectGuid>{E3319DF1-30AA-4B43-82A3-B66463F07305}</ProjectGuid>
+    <OutputType>WinExe</OutputType>
+    <AppDesignerFolder>Properties</AppDesignerFolder>
+    <RootNamespace>virEventRegisterImpl</RootNamespace>
+    <AssemblyName>virEventRegisterImpl</AssemblyName>
+    <TargetFrameworkVersion>v4.0</TargetFrameworkVersion>
+    <TargetFrameworkProfile>Client</TargetFrameworkProfile>
+    <FileAlignment>512</FileAlignment>
+  </PropertyGroup>
+  <PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Debug|x86' ">
+    <PlatformTarget>x86</PlatformTarget>
+    <DebugSymbols>true</DebugSymbols>
+    <DebugType>full</DebugType>
+    <Optimize>false</Optimize>
+    <OutputPath>bin\Debug\</OutputPath>
+    <DefineConstants>DEBUG;TRACE</DefineConstants>
+    <ErrorReport>prompt</ErrorReport>
+    <WarningLevel>4</WarningLevel>
+  </PropertyGroup>
+  <PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Release|x86' ">
+    <PlatformTarget>x86</PlatformTarget>
+    <DebugType>pdbonly</DebugType>
+    <Optimize>true</Optimize>
+    <OutputPath>bin\Release\</OutputPath>
+    <DefineConstants>TRACE</DefineConstants>
+    <ErrorReport>prompt</ErrorReport>
+    <WarningLevel>4</WarningLevel>
+  </PropertyGroup>
+  <ItemGroup>
+    <Reference Include="System" />
+    <Reference Include="System.Core" />
+    <Reference Include="System.Xml.Linq" />
+    <Reference Include="System.Data.DataSetExtensions" />
+    <Reference Include="Microsoft.CSharp" />
+    <Reference Include="System.Data" />
+    <Reference Include="System.Deployment" />
+    <Reference Include="System.Drawing" />
+    <Reference Include="System.Windows.Forms" />
+    <Reference Include="System.Xml" />
+  </ItemGroup>
+  <ItemGroup>
+    <Compile Include="Form1.cs">
+      <SubType>Form</SubType>
+    </Compile>
+    <Compile Include="Form1.Designer.cs">
+      <DependentUpon>Form1.cs</DependentUpon>
+    </Compile>
+    <Compile Include="Program.cs" />
+    <Compile Include="Properties\AssemblyInfo.cs" />
+    <EmbeddedResource Include="Form1.resx">
+      <DependentUpon>Form1.cs</DependentUpon>
+    </EmbeddedResource>
+    <EmbeddedResource Include="Properties\Resources.resx">
+      <Generator>ResXFileCodeGenerator</Generator>
+      <LastGenOutput>Resources.Designer.cs</LastGenOutput>
+      <SubType>Designer</SubType>
+    </EmbeddedResource>
+    <Compile Include="Properties\Resources.Designer.cs">
+      <AutoGen>True</AutoGen>
+      <DependentUpon>Resources.resx</DependentUpon>
+    </Compile>
+    <None Include="Properties\Settings.settings">
+      <Generator>SettingsSingleFileGenerator</Generator>
+      <LastGenOutput>Settings.Designer.cs</LastGenOutput>
+    </None>
+    <Compile Include="Properties\Settings.Designer.cs">
+      <AutoGen>True</AutoGen>
+      <DependentUpon>Settings.settings</DependentUpon>
+      <DesignTimeSharedInput>True</DesignTimeSharedInput>
+    </Compile>
+  </ItemGroup>
+  <ItemGroup>
+    <ProjectReference Include="..\..\..\projects\VisualStudio\LibvirtBindings.csproj">
+      <Project>{592FE0DB-C205-4934-BD20-79BDAB1584C1}</Project>
+      <Name>LibvirtBindings</Name>
+    </ProjectReference>
+  </ItemGroup>
+  <Import Project="$(MSBuildToolsPath)\Microsoft.CSharp.targets" />
+  <!-- To modify your build process, add your task inside one of the targets below and uncomment it. 
+       Other similar extension points exist, see Microsoft.Common.targets.
+  <Target Name="BeforeBuild">
+  </Target>
+  <Target Name="AfterBuild">
+  </Target>
+  -->
+</Project>
\ No newline at end of file
diff --git a/projects/MonoDevelop/LibvirtBindings.sln b/projects/MonoDevelop/LibvirtBindings.sln
index 25753ff..d0cf60c 100644
--- a/projects/MonoDevelop/LibvirtBindings.sln
+++ b/projects/MonoDevelop/LibvirtBindings.sln
@@ -9,6 +9,8 @@ Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "virConnectOpenAuth", "..\..
 EndProject
 Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "virConnectOpen", "..\..\examples\MonoDevelop\virConnectOpen\virConnectOpen.csproj", "{FFCD939E-7F9A-44D5-AEBC-84F40942E8B5}"
 EndProject
+Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "virEventRegisterImpl", "..\..\examples\MonoDevelop\virEventRegisterImpl\virEventRegisterImpl.csproj", "{4576BB61-F143-4BC8-BD1D-D50F710CEA10}"
+EndProject
 Global
 	GlobalSection(SolutionConfigurationPlatforms) = preSolution
 		Debug|Any CPU = Debug|Any CPU
@@ -19,6 +21,10 @@ Global
 		{3259AE36-B12F-435E-9124-F6CAA781AD5C}.Debug|Any CPU.Build.0 = Debug|Any CPU
 		{3259AE36-B12F-435E-9124-F6CAA781AD5C}.Release|Any CPU.ActiveCfg = Release|Any CPU
 		{3259AE36-B12F-435E-9124-F6CAA781AD5C}.Release|Any CPU.Build.0 = Release|Any CPU
+		{4576BB61-F143-4BC8-BD1D-D50F710CEA10}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
+		{4576BB61-F143-4BC8-BD1D-D50F710CEA10}.Debug|Any CPU.Build.0 = Debug|Any CPU
+		{4576BB61-F143-4BC8-BD1D-D50F710CEA10}.Release|Any CPU.ActiveCfg = Release|Any CPU
+		{4576BB61-F143-4BC8-BD1D-D50F710CEA10}.Release|Any CPU.Build.0 = Release|Any CPU
 		{C51C70EB-9040-4F8E-9A18-DF2A77D04A37}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
 		{C51C70EB-9040-4F8E-9A18-DF2A77D04A37}.Debug|Any CPU.Build.0 = Debug|Any CPU
 		{C51C70EB-9040-4F8E-9A18-DF2A77D04A37}.Release|Any CPU.ActiveCfg = Release|Any CPU
@@ -31,8 +37,9 @@ Global
 	GlobalSection(NestedProjects) = preSolution
 		{3259AE36-B12F-435E-9124-F6CAA781AD5C} = {504BA6A7-9D0E-44BA-827D-D797773347FD}
 		{FFCD939E-7F9A-44D5-AEBC-84F40942E8B5} = {504BA6A7-9D0E-44BA-827D-D797773347FD}
+		{4576BB61-F143-4BC8-BD1D-D50F710CEA10} = {504BA6A7-9D0E-44BA-827D-D797773347FD}
 	EndGlobalSection
 	GlobalSection(MonoDevelopProperties) = preSolution
-		StartupItem = ..\..\examples\MonoDevelop\virConnectOpenAuth\virConnectOpenAuth.csproj
+		StartupItem = ..\..\examples\MonoDevelop\virEventRegisterImpl\virEventRegisterImpl.csproj
 	EndGlobalSection
 EndGlobal
diff --git a/projects/VisualStudio/LibvirtBindings.sln b/projects/VisualStudio/LibvirtBindings.sln
index 173577c..785a866 100644
--- a/projects/VisualStudio/LibvirtBindings.sln
+++ b/projects/VisualStudio/LibvirtBindings.sln
@@ -9,6 +9,8 @@ Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "virConnectOpenAuth", "..\..
 EndProject
 Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "virConnectOpen", "..\..\examples\VisualStudio\virConnectOpen\virConnectOpen.csproj", "{54F79BD5-8E81-4100-BD13-C63072D00B0B}"
 EndProject
+Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "virEventRegisterImpl", "..\..\examples\VisualStudio\virEventRegisterImpl\virEventRegisterImpl.csproj", "{E3319DF1-30AA-4B43-82A3-B66463F07305}"
+EndProject
 Global
 	GlobalSection(SolutionConfigurationPlatforms) = preSolution
 		Debug|Any CPU = Debug|Any CPU
@@ -49,6 +51,16 @@ Global
 		{54F79BD5-8E81-4100-BD13-C63072D00B0B}.Release|Mixed Platforms.Build.0 = Release|x86
 		{54F79BD5-8E81-4100-BD13-C63072D00B0B}.Release|x86.ActiveCfg = Release|x86
 		{54F79BD5-8E81-4100-BD13-C63072D00B0B}.Release|x86.Build.0 = Release|x86
+		{E3319DF1-30AA-4B43-82A3-B66463F07305}.Debug|Any CPU.ActiveCfg = Debug|x86
+		{E3319DF1-30AA-4B43-82A3-B66463F07305}.Debug|Mixed Platforms.ActiveCfg = Debug|x86
+		{E3319DF1-30AA-4B43-82A3-B66463F07305}.Debug|Mixed Platforms.Build.0 = Debug|x86
+		{E3319DF1-30AA-4B43-82A3-B66463F07305}.Debug|x86.ActiveCfg = Debug|x86
+		{E3319DF1-30AA-4B43-82A3-B66463F07305}.Debug|x86.Build.0 = Debug|x86
+		{E3319DF1-30AA-4B43-82A3-B66463F07305}.Release|Any CPU.ActiveCfg = Release|x86
+		{E3319DF1-30AA-4B43-82A3-B66463F07305}.Release|Mixed Platforms.ActiveCfg = Release|x86
+		{E3319DF1-30AA-4B43-82A3-B66463F07305}.Release|Mixed Platforms.Build.0 = Release|x86
+		{E3319DF1-30AA-4B43-82A3-B66463F07305}.Release|x86.ActiveCfg = Release|x86
+		{E3319DF1-30AA-4B43-82A3-B66463F07305}.Release|x86.Build.0 = Release|x86
 	EndGlobalSection
 	GlobalSection(SolutionProperties) = preSolution
 		HideSolutionNode = FALSE
@@ -56,5 +68,6 @@ Global
 	GlobalSection(NestedProjects) = preSolution
 		{F88B2E89-C3E6-4C69-881B-EB2AB4DE6CB3} = {AB0DC218-8ABA-4351-AD87-361AF7AF71C9}
 		{54F79BD5-8E81-4100-BD13-C63072D00B0B} = {AB0DC218-8ABA-4351-AD87-361AF7AF71C9}
+		{E3319DF1-30AA-4B43-82A3-B66463F07305} = {AB0DC218-8ABA-4351-AD87-361AF7AF71C9}
 	EndGlobalSection
 EndGlobal
-- 
1.7.2.3.msysgit.0

