>From 05bc17c3894a319a2f1186f5da8ae4f3a96a0f46 Mon Sep 17 00:00:00 2001
From: Arnaud <arnaud.champion@devatom.fr>
Date: Tue, 19 Oct 2010 16:02:54 +0200
Subject: [PATCH] Add Visual Studio 2010 and MonoDevelop solution and project
 Add Visual Studio and MonoDevelop "virConnectAuth" sample code

---
 StringWithoutNativeCleanUpMarshaler.cs             |   36 ++++
 .../MonoDevelop/virConnectOpenAuth/AssemblyInfo.cs |   27 +++
 examples/MonoDevelop/virConnectOpenAuth/Main.cs    |   17 ++
 .../MonoDevelop/virConnectOpenAuth/MainWindow.cs   |  159 +++++++++++++++
 .../virConnectOpenAuth/gtk-gui/MainWindow.cs       |  146 ++++++++++++++
 .../virConnectOpenAuth/gtk-gui/generated.cs        |   29 +++
 .../virConnectOpenAuth/gtk-gui/gui.stetic          |  208 ++++++++++++++++++++
 .../virConnectOpenAuth/virConnectOpenAuth.csproj   |   61 ++++++
 .../virConnectOpenAuth/Form1.Designer.cs           |  156 +++++++++++++++
 examples/VisualStudio/virConnectOpenAuth/Form1.cs  |  153 ++++++++++++++
 .../VisualStudio/virConnectOpenAuth/Form1.resx     |  120 +++++++++++
 .../VisualStudio/virConnectOpenAuth/Program.cs     |   28 +++
 .../virConnectOpenAuth/Properties/AssemblyInfo.cs  |   36 ++++
 .../Properties/Resources.Designer.cs               |   71 +++++++
 .../virConnectOpenAuth/Properties/Resources.resx   |  117 +++++++++++
 .../Properties/Settings.Designer.cs                |   30 +++
 .../Properties/Settings.settings                   |    7 +
 .../virConnectOpenAuth/virConnectOpenAuth.csproj   |   93 +++++++++
 projects/MonoDevelop/AssemblyInfo.cs               |   27 +++
 projects/MonoDevelop/LibvirtBindings.csproj        |   51 +++++
 projects/MonoDevelop/LibvirtBindings.sln           |   31 +++
 projects/VisualStudio/LibvirtBindings.csproj       |   65 ++++++
 projects/VisualStudio/LibvirtBindings.sln          |   47 +++++
 projects/VisualStudio/Properties/AssemblyInfo.cs   |   36 ++++
 24 files changed, 1751 insertions(+), 0 deletions(-)
 create mode 100644 StringWithoutNativeCleanUpMarshaler.cs
 create mode 100644 examples/MonoDevelop/virConnectOpenAuth/AssemblyInfo.cs
 create mode 100644 examples/MonoDevelop/virConnectOpenAuth/Main.cs
 create mode 100644 examples/MonoDevelop/virConnectOpenAuth/MainWindow.cs
 create mode 100644 examples/MonoDevelop/virConnectOpenAuth/gtk-gui/MainWindow.cs
 create mode 100644 examples/MonoDevelop/virConnectOpenAuth/gtk-gui/generated.cs
 create mode 100644 examples/MonoDevelop/virConnectOpenAuth/gtk-gui/gui.stetic
 create mode 100644 examples/MonoDevelop/virConnectOpenAuth/virConnectOpenAuth.csproj
 create mode 100644 examples/VisualStudio/virConnectOpenAuth/Form1.Designer.cs
 create mode 100644 examples/VisualStudio/virConnectOpenAuth/Form1.cs
 create mode 100644 examples/VisualStudio/virConnectOpenAuth/Form1.resx
 create mode 100644 examples/VisualStudio/virConnectOpenAuth/Program.cs
 create mode 100644 examples/VisualStudio/virConnectOpenAuth/Properties/AssemblyInfo.cs
 create mode 100644 examples/VisualStudio/virConnectOpenAuth/Properties/Resources.Designer.cs
 create mode 100644 examples/VisualStudio/virConnectOpenAuth/Properties/Resources.resx
 create mode 100644 examples/VisualStudio/virConnectOpenAuth/Properties/Settings.Designer.cs
 create mode 100644 examples/VisualStudio/virConnectOpenAuth/Properties/Settings.settings
 create mode 100644 examples/VisualStudio/virConnectOpenAuth/virConnectOpenAuth.csproj
 create mode 100644 projects/MonoDevelop/AssemblyInfo.cs
 create mode 100644 projects/MonoDevelop/LibvirtBindings.csproj
 create mode 100644 projects/MonoDevelop/LibvirtBindings.sln
 create mode 100644 projects/VisualStudio/LibvirtBindings.csproj
 create mode 100644 projects/VisualStudio/LibvirtBindings.sln
 create mode 100644 projects/VisualStudio/Properties/AssemblyInfo.cs

diff --git a/StringWithoutNativeCleanUpMarshaler.cs b/StringWithoutNativeCleanUpMarshaler.cs
new file mode 100644
index 0000000..45cd447
--- /dev/null
+++ b/StringWithoutNativeCleanUpMarshaler.cs
@@ -0,0 +1,36 @@
+﻿using System;
+using System.Runtime.InteropServices;
+
+namespace LibvirtBindings
+{
+    class StringWithoutNativeCleanUpMarshaler : ICustomMarshaler
+    {
+        public static ICustomMarshaler GetInstance(string cookie)
+        {
+            return new StringWithoutNativeCleanUpMarshaler();
+        }
+
+        public object MarshalNativeToManaged(IntPtr pNativeData)
+        {
+            return Marshal.PtrToStringAnsi(pNativeData);
+        }
+
+        public IntPtr MarshalManagedToNative(object ManagedObj)
+        {
+            return Marshal.StringToHGlobalAnsi((string) ManagedObj);
+        }
+
+        public void CleanUpNativeData(IntPtr pNativeData)
+        {
+        }
+
+        public void CleanUpManagedData(object ManagedObj)
+        {
+        }
+
+        public int GetNativeDataSize()
+        {
+            throw new NotImplementedException();
+        }
+    }
+}
diff --git a/examples/MonoDevelop/virConnectOpenAuth/AssemblyInfo.cs b/examples/MonoDevelop/virConnectOpenAuth/AssemblyInfo.cs
new file mode 100644
index 0000000..a57fdd5
--- /dev/null
+++ b/examples/MonoDevelop/virConnectOpenAuth/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("virConnectOpenAuth")]
+[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/virConnectOpenAuth/Main.cs b/examples/MonoDevelop/virConnectOpenAuth/Main.cs
new file mode 100644
index 0000000..8be91ff
--- /dev/null
+++ b/examples/MonoDevelop/virConnectOpenAuth/Main.cs
@@ -0,0 +1,17 @@
+using System;
+using Gtk;
+
+namespace virConnectOpenAuth
+{
+	class MainClass
+	{
+		public static void Main (string[] args)
+		{
+			Application.Init ();
+			MainWindow win = new MainWindow ();
+			win.Show ();
+			Application.Run ();
+		}
+	}
+}
+
diff --git a/examples/MonoDevelop/virConnectOpenAuth/MainWindow.cs b/examples/MonoDevelop/virConnectOpenAuth/MainWindow.cs
new file mode 100644
index 0000000..fdbf318
--- /dev/null
+++ b/examples/MonoDevelop/virConnectOpenAuth/MainWindow.cs
@@ -0,0 +1,159 @@
+using System;
+using Gtk;
+using LibvirtBindings;
+using System.Runtime.InteropServices;
+
+public partial class MainWindow : Gtk.Window
+{
+	struct AuthData
+    {
+        public string user_name;
+        public string password;
+    }
+	
+	ListStore domainListStore = new ListStore(typeof(string));
+	TreeViewColumn tvcDomains = new TreeViewColumn();
+	
+	public MainWindow () : base(Gtk.WindowType.Toplevel)
+	{
+		Build ();
+		
+		tvcDomains.Title = "Domains";
+		treeview1.AppendColumn(tvcDomains);
+		
+		treeview1.Model = domainListStore;
+	}
+
+	protected void OnDeleteEvent (object sender, DeleteEventArgs a)
+	{
+		Application.Quit ();
+		a.RetVal = true;
+	}
+	protected virtual void OnButton1Clicked (object sender, System.EventArgs e)
+	{
+		// Fill a structure to pass username and password to callbacks
+        AuthData authData = new AuthData { password = entry3.Text, user_name = entry2.Text };
+		
+		// Fill a virConnectAuth structure
+        virConnectAuth auth = new virConnectAuth
+        {
+            cbdata = authData,                  // The authData structure
+            cb = AuthCallback,                  // the method called by callbacks
+            CredTypes = new[]
+                            {
+                                virConnectCredentialType.VIR_CRED_AUTHNAME,
+                                virConnectCredentialType.VIR_CRED_PASSPHRASE
+                            }          // The list of credentials types
+        };
+		
+		// Request the connection
+        IntPtr conn = libVirt.virConnectOpenAuth(entry1.Text, ref auth, 0);
+		
+		if (conn != IntPtr.Zero)
+        {
+            // Get the number of defined (not running) domains
+            int numOfDefinedDomains = libVirt.virConnectNumOfDefinedDomains(conn);
+            string[] definedDomainNames = new string[numOfDefinedDomains];
+            if (libVirt.virConnectListDefinedDomains(conn, ref definedDomainNames, numOfDefinedDomains) == -1)
+            {
+				ShowError("Unable to list defined domains");
+                return;
+            }
+			
+            // Add the domain names to the listbox
+            foreach (string domainName in definedDomainNames)
+			{
+                AddDomainInTreeView(domainName);
+			}
+			
+            // Get the number of running domains
+            int numOfRunningDomain = libVirt.virConnectNumOfDomains(conn);
+            int[] runningDomainIDs = new int[numOfRunningDomain];
+            if (libVirt.virConnectListDomains(conn, runningDomainIDs, numOfRunningDomain) == -1)
+            {
+                ShowError("Unable to list running domains");
+                return;
+            }
+			
+            // Add the domain names to the listbox
+            foreach (int runningDomainID in runningDomainIDs)
+            {
+                IntPtr domainPtr = libVirt.virDomainLookupByID(conn, runningDomainID);
+                if (domainPtr == IntPtr.Zero)
+                {
+                    ShowError("Unable to lookup domains by id");
+                    return;
+                }
+                string domainName = libVirt.virDomainGetName(domainPtr);
+                if (string.IsNullOrEmpty(domainName))
+                {
+                    ShowError("Unable to get domain name");
+                    return;
+                }
+                AddDomainInTreeView(domainName);
+            }
+            libVirt.virConnectClose(conn);
+        }
+        else
+        {
+            ShowError("Unable to connect");
+        }
+	}
+	
+	private void ShowError(string errorMessage)
+	{
+		MessageDialog errorMsg = new MessageDialog(this, DialogFlags.Modal, MessageType.Error, ButtonsType.Close, errorMessage);
+        errorMsg.Title = "Error";
+		if ((ResponseType) errorMsg.Run() == ResponseType.Close)
+		{ 
+        	errorMsg.Destroy(); 
+		}
+	}
+	
+	private void AddDomainInTreeView(string domainName)
+	{
+		domainListStore.AppendValues(domainName);
+		CellRendererText crtDomainCell = new CellRendererText();
+		tvcDomains.PackStart(crtDomainCell, true);
+		tvcDomains.AddAttribute(crtDomainCell, "text", 0);
+	}
+	
+	private static int AuthCallback(IntPtr creds, uint ncred, IntPtr cbdata)
+        {
+            // Get the AuthData structure
+            AuthData authData = (AuthData)Marshal.PtrToStructure(cbdata, typeof(AuthData));
+            int offset = 0;
+            int credIndex = 0;
+
+            while (credIndex < ncred)
+            {
+                IntPtr currentCred = new IntPtr(creds.ToInt32() + offset);
+
+                virConnectCredential cred = (virConnectCredential) Marshal.PtrToStructure(currentCred, typeof(virConnectCredential));
+                offset += Marshal.SizeOf(cred);
+                switch (cred.type)
+                {
+                    case virConnectCredentialType.VIR_CRED_AUTHNAME:
+                        // Fill the user name
+                        cred.Result = authData.user_name;
+                        cred.resultlen = (uint)authData.user_name.Length;
+                        break;
+                    case virConnectCredentialType.VIR_CRED_PASSPHRASE:
+                        // Fill the password
+                        cred.Result = authData.password;
+                        cred.resultlen = (uint)authData.password.Length;
+                        break;
+                    default:
+                        return -1;
+                }
+                // Write structure to the unmanaged address
+                Marshal.StructureToPtr(cred, currentCred, true);
+
+                credIndex++;
+            }
+            return 0;
+        }
+	
+	
+}
+
diff --git a/examples/MonoDevelop/virConnectOpenAuth/gtk-gui/MainWindow.cs b/examples/MonoDevelop/virConnectOpenAuth/gtk-gui/MainWindow.cs
new file mode 100644
index 0000000..13fb8a6
--- /dev/null
+++ b/examples/MonoDevelop/virConnectOpenAuth/gtk-gui/MainWindow.cs
@@ -0,0 +1,146 @@
+
+// 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.Entry entry2;
+
+	private global::Gtk.Entry entry3;
+
+	private global::Gtk.ScrolledWindow GtkScrolledWindow;
+
+	private global::Gtk.TreeView treeview1;
+
+	private global::Gtk.Label label1;
+
+	private global::Gtk.Label label2;
+
+	private global::Gtk.Label label3;
+
+	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));
+		this.DefaultWidth = 200;
+		this.DefaultHeight = 200;
+		// Container child MainWindow.Gtk.Container+ContainerChild
+		this.table1 = new global::Gtk.Table (((uint)(5)), ((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)(3));
+		w1.BottomAttach = ((uint)(4));
+		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 ("esx://192.168.220.194?transport=http");
+		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.entry2 = new global::Gtk.Entry ();
+		this.entry2.CanFocus = true;
+		this.entry2.Name = "entry2";
+		this.entry2.Text = global::Mono.Unix.Catalog.GetString ("root");
+		this.entry2.IsEditable = true;
+		this.table1.Add (this.entry2);
+		global::Gtk.Table.TableChild w3 = ((global::Gtk.Table.TableChild)(this.table1[this.entry2]));
+		w3.TopAttach = ((uint)(1));
+		w3.BottomAttach = ((uint)(2));
+		w3.LeftAttach = ((uint)(1));
+		w3.RightAttach = ((uint)(2));
+		w3.XOptions = ((global::Gtk.AttachOptions)(4));
+		w3.YOptions = ((global::Gtk.AttachOptions)(4));
+		// Container child table1.Gtk.Table+TableChild
+		this.entry3 = new global::Gtk.Entry ();
+		this.entry3.CanFocus = true;
+		this.entry3.Name = "entry3";
+		this.entry3.Text = global::Mono.Unix.Catalog.GetString ("nmrojvbnpG2B");
+		this.entry3.IsEditable = true;
+		this.table1.Add (this.entry3);
+		global::Gtk.Table.TableChild w4 = ((global::Gtk.Table.TableChild)(this.table1[this.entry3]));
+		w4.TopAttach = ((uint)(2));
+		w4.BottomAttach = ((uint)(3));
+		w4.LeftAttach = ((uint)(1));
+		w4.RightAttach = ((uint)(2));
+		w4.XOptions = ((global::Gtk.AttachOptions)(4));
+		w4.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.treeview1 = new global::Gtk.TreeView ();
+		this.treeview1.CanFocus = true;
+		this.treeview1.Name = "treeview1";
+		this.GtkScrolledWindow.Add (this.treeview1);
+		this.table1.Add (this.GtkScrolledWindow);
+		global::Gtk.Table.TableChild w6 = ((global::Gtk.Table.TableChild)(this.table1[this.GtkScrolledWindow]));
+		w6.TopAttach = ((uint)(4));
+		w6.BottomAttach = ((uint)(5));
+		w6.LeftAttach = ((uint)(1));
+		w6.RightAttach = ((uint)(2));
+		w6.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 w7 = ((global::Gtk.Table.TableChild)(this.table1[this.label1]));
+		w7.XOptions = ((global::Gtk.AttachOptions)(4));
+		w7.YOptions = ((global::Gtk.AttachOptions)(4));
+		// Container child table1.Gtk.Table+TableChild
+		this.label2 = new global::Gtk.Label ();
+		this.label2.Name = "label2";
+		this.label2.LabelProp = global::Mono.Unix.Catalog.GetString ("Username :");
+		this.table1.Add (this.label2);
+		global::Gtk.Table.TableChild w8 = ((global::Gtk.Table.TableChild)(this.table1[this.label2]));
+		w8.TopAttach = ((uint)(1));
+		w8.BottomAttach = ((uint)(2));
+		w8.XOptions = ((global::Gtk.AttachOptions)(4));
+		w8.YOptions = ((global::Gtk.AttachOptions)(4));
+		// Container child table1.Gtk.Table+TableChild
+		this.label3 = new global::Gtk.Label ();
+		this.label3.Name = "label3";
+		this.label3.LabelProp = global::Mono.Unix.Catalog.GetString ("Password :");
+		this.table1.Add (this.label3);
+		global::Gtk.Table.TableChild w9 = ((global::Gtk.Table.TableChild)(this.table1[this.label3]));
+		w9.TopAttach = ((uint)(2));
+		w9.BottomAttach = ((uint)(3));
+		w9.XOptions = ((global::Gtk.AttachOptions)(4));
+		w9.YOptions = ((global::Gtk.AttachOptions)(4));
+		this.Add (this.table1);
+		if ((this.Child != null)) {
+			this.Child.ShowAll ();
+		}
+		this.Show ();
+		this.DeleteEvent += new global::Gtk.DeleteEventHandler (this.OnDeleteEvent);
+		this.button1.Clicked += new global::System.EventHandler (this.OnButton1Clicked);
+	}
+}
diff --git a/examples/MonoDevelop/virConnectOpenAuth/gtk-gui/generated.cs b/examples/MonoDevelop/virConnectOpenAuth/gtk-gui/generated.cs
new file mode 100644
index 0000000..8463caa
--- /dev/null
+++ b/examples/MonoDevelop/virConnectOpenAuth/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/virConnectOpenAuth/gtk-gui/gui.stetic b/examples/MonoDevelop/virConnectOpenAuth/gtk-gui/gui.stetic
new file mode 100644
index 0000000..6942e10
--- /dev/null
+++ b/examples/MonoDevelop/virConnectOpenAuth/gtk-gui/gui.stetic
@@ -0,0 +1,208 @@
+﻿<?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\virConnectOpenAuth.exe" internal="true" />
+  </import>
+  <widget class="Gtk.Window" id="MainWindow" design-size="239 403">
+    <property name="MemberName" />
+    <property name="Title" translatable="yes">MainWindow</property>
+    <property name="WindowPosition">CenterOnParent</property>
+    <property name="DefaultWidth">200</property>
+    <property name="DefaultHeight">200</property>
+    <signal name="DeleteEvent" handler="OnDeleteEvent" />
+    <child>
+      <widget class="Gtk.Table" id="table1">
+        <property name="MemberName" />
+        <property name="NRows">5</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">3</property>
+            <property name="BottomAttach">4</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">esx://192.168.220.194?transport=http</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.Entry" id="entry2">
+            <property name="MemberName" />
+            <property name="CanFocus">True</property>
+            <property name="Text" translatable="yes">root</property>
+            <property name="IsEditable">True</property>
+          </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="entry3">
+            <property name="MemberName" />
+            <property name="CanFocus">True</property>
+            <property name="Text" translatable="yes">nmrojvbnpG2B</property>
+            <property name="IsEditable">True</property>
+          </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="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.TreeView" id="treeview1">
+                <property name="MemberName" />
+                <property name="CanFocus">True</property>
+                <property name="ShowScrollbars">True</property>
+              </widget>
+            </child>
+          </widget>
+          <packing>
+            <property name="TopAttach">4</property>
+            <property name="BottomAttach">5</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>
+        <child>
+          <widget class="Gtk.Label" id="label2">
+            <property name="MemberName" />
+            <property name="LabelProp" translatable="yes">Username :</property>
+          </widget>
+          <packing>
+            <property name="TopAttach">1</property>
+            <property name="BottomAttach">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.Label" id="label3">
+            <property name="MemberName" />
+            <property name="LabelProp" translatable="yes">Password :</property>
+          </widget>
+          <packing>
+            <property name="TopAttach">2</property>
+            <property name="BottomAttach">3</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>
+      </widget>
+    </child>
+  </widget>
+</stetic-interface>
\ No newline at end of file
diff --git a/examples/MonoDevelop/virConnectOpenAuth/virConnectOpenAuth.csproj b/examples/MonoDevelop/virConnectOpenAuth/virConnectOpenAuth.csproj
new file mode 100644
index 0000000..32b20d4
--- /dev/null
+++ b/examples/MonoDevelop/virConnectOpenAuth/virConnectOpenAuth.csproj
@@ -0,0 +1,61 @@
+<?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>{3259AE36-B12F-435E-9124-F6CAA781AD5C}</ProjectGuid>
+    <OutputType>WinExe</OutputType>
+    <RootNamespace>virConnectOpenAuth</RootNamespace>
+    <AssemblyName>virConnectOpenAuth</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/virConnectOpenAuth/Form1.Designer.cs b/examples/VisualStudio/virConnectOpenAuth/Form1.Designer.cs
new file mode 100644
index 0000000..3a3a980
--- /dev/null
+++ b/examples/VisualStudio/virConnectOpenAuth/Form1.Designer.cs
@@ -0,0 +1,156 @@
+﻿namespace virConnectOpenAuth
+{
+    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.tbUsername = new System.Windows.Forms.TextBox();
+            this.label2 = new System.Windows.Forms.Label();
+            this.tbPassword = new System.Windows.Forms.TextBox();
+            this.label3 = new System.Windows.Forms.Label();
+            this.btnConnect = new System.Windows.Forms.Button();
+            this.gbDomains = new System.Windows.Forms.GroupBox();
+            this.lbDomains = new System.Windows.Forms.ListBox();
+            this.gbDomains.SuspendLayout();
+            this.SuspendLayout();
+            // 
+            // tbURI
+            // 
+            this.tbURI.Location = new System.Drawing.Point(77, 12);
+            this.tbURI.Name = "tbURI";
+            this.tbURI.Size = new System.Drawing.Size(195, 20);
+            this.tbURI.TabIndex = 0;
+            this.tbURI.Text = "esx://192.168.220.194?transport=http";
+            // 
+            // 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 :";
+            // 
+            // tbUsername
+            // 
+            this.tbUsername.Location = new System.Drawing.Point(77, 38);
+            this.tbUsername.Name = "tbUsername";
+            this.tbUsername.Size = new System.Drawing.Size(195, 20);
+            this.tbUsername.TabIndex = 2;
+            this.tbUsername.Text = "root";
+            // 
+            // label2
+            // 
+            this.label2.AutoSize = true;
+            this.label2.Location = new System.Drawing.Point(12, 41);
+            this.label2.Name = "label2";
+            this.label2.Size = new System.Drawing.Size(61, 13);
+            this.label2.TabIndex = 3;
+            this.label2.Text = "Username :";
+            // 
+            // tbPassword
+            // 
+            this.tbPassword.Location = new System.Drawing.Point(77, 64);
+            this.tbPassword.Name = "tbPassword";
+            this.tbPassword.Size = new System.Drawing.Size(195, 20);
+            this.tbPassword.TabIndex = 4;
+            this.tbPassword.Text = "nmrojvbnpG2B";
+            // 
+            // label3
+            // 
+            this.label3.AutoSize = true;
+            this.label3.Location = new System.Drawing.Point(12, 67);
+            this.label3.Name = "label3";
+            this.label3.Size = new System.Drawing.Size(59, 13);
+            this.label3.TabIndex = 5;
+            this.label3.Text = "Password :";
+            // 
+            // btnConnect
+            // 
+            this.btnConnect.Location = new System.Drawing.Point(197, 90);
+            this.btnConnect.Name = "btnConnect";
+            this.btnConnect.Size = new System.Drawing.Size(75, 23);
+            this.btnConnect.TabIndex = 6;
+            this.btnConnect.Text = "Connect";
+            this.btnConnect.UseVisualStyleBackColor = true;
+            this.btnConnect.Click += new System.EventHandler(this.btnConnect_Click);
+            // 
+            // gbDomains
+            // 
+            this.gbDomains.Controls.Add(this.lbDomains);
+            this.gbDomains.Location = new System.Drawing.Point(15, 119);
+            this.gbDomains.Name = "gbDomains";
+            this.gbDomains.Size = new System.Drawing.Size(257, 131);
+            this.gbDomains.TabIndex = 7;
+            this.gbDomains.TabStop = false;
+            this.gbDomains.Text = "Domains";
+            // 
+            // lbDomains
+            // 
+            this.lbDomains.FormattingEnabled = true;
+            this.lbDomains.Location = new System.Drawing.Point(6, 19);
+            this.lbDomains.Name = "lbDomains";
+            this.lbDomains.Size = new System.Drawing.Size(245, 95);
+            this.lbDomains.TabIndex = 0;
+            // 
+            // 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.gbDomains);
+            this.Controls.Add(this.btnConnect);
+            this.Controls.Add(this.label3);
+            this.Controls.Add(this.tbPassword);
+            this.Controls.Add(this.label2);
+            this.Controls.Add(this.tbUsername);
+            this.Controls.Add(this.label1);
+            this.Controls.Add(this.tbURI);
+            this.Name = "Form1";
+            this.Text = "virConnectOpenAuth sample";
+            this.gbDomains.ResumeLayout(false);
+            this.ResumeLayout(false);
+            this.PerformLayout();
+
+        }
+
+        #endregion
+
+        private System.Windows.Forms.TextBox tbURI;
+        private System.Windows.Forms.Label label1;
+        private System.Windows.Forms.TextBox tbUsername;
+        private System.Windows.Forms.Label label2;
+        private System.Windows.Forms.TextBox tbPassword;
+        private System.Windows.Forms.Label label3;
+        private System.Windows.Forms.Button btnConnect;
+        private System.Windows.Forms.GroupBox gbDomains;
+        private System.Windows.Forms.ListBox lbDomains;
+    }
+}
+
diff --git a/examples/VisualStudio/virConnectOpenAuth/Form1.cs b/examples/VisualStudio/virConnectOpenAuth/Form1.cs
new file mode 100644
index 0000000..ce9a896
--- /dev/null
+++ b/examples/VisualStudio/virConnectOpenAuth/Form1.cs
@@ -0,0 +1,153 @@
+﻿/*
+ * 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 :
+ *      virConnectOpenAuth
+ *      virConnectNumOfDefinedDomains
+ *      virConnectListDefinedDomains
+ *      virConnectNumOfDomains
+ *      virDomainLookupByID
+ *      virConnectListDomains
+ *      virDomainGetName
+ *      virConnectClose
+ * Types :
+ *      virConnectAuth
+ *      virConnectCredential
+ *      virConnectCredentialType
+ */
+
+using System;
+using System.Runtime.InteropServices;
+using System.Windows.Forms;
+using LibvirtBindings;
+
+namespace virConnectOpenAuth
+{
+    struct AuthData
+    {
+        public string user_name;
+        public string password;
+    }
+
+    public partial class Form1 : Form
+    {
+        public Form1()
+        {
+            InitializeComponent();
+        }
+
+        private void btnConnect_Click(object sender, EventArgs e)
+        {
+            // Fill a structure to pass username and password to callbacks
+            AuthData authData = new AuthData { password = tbPassword.Text, user_name = tbUsername.Text };
+
+            // Fill a virConnectAuth structure
+            virConnectAuth auth = new virConnectAuth
+            {
+                cbdata = authData,                  // The authData structure
+                cb = AuthCallback,                  // the method called by callbacks
+                CredTypes = new[]
+                                {
+                                    virConnectCredentialType.VIR_CRED_AUTHNAME,
+                                    virConnectCredentialType.VIR_CRED_PASSPHRASE
+                                }          // The list of credentials types
+            };
+
+            // Request the connection
+            IntPtr conn = libVirt.virConnectOpenAuth(tbURI.Text, ref auth, 0);
+
+            if (conn != IntPtr.Zero)
+            {
+                // Get the number of defined (not running) domains
+                int numOfDefinedDomains = libVirt.virConnectNumOfDefinedDomains(conn);
+                string[] definedDomainNames = new string[numOfDefinedDomains];
+                if (libVirt.virConnectListDefinedDomains(conn, ref definedDomainNames, numOfDefinedDomains) == -1)
+                {
+                   MessageBox.Show("Unable to list defined domains", "List defined domains failed", MessageBoxButtons.OK,
+                                    MessageBoxIcon.Error);
+                    return;
+                }
+
+                // Add the domain names to the listbox
+                foreach (string domainName in definedDomainNames)
+                    lbDomains.Items.Add(domainName);
+
+                // Get the number of running domains
+                int numOfRunningDomain = libVirt.virConnectNumOfDomains(conn);
+                int[] runningDomainIDs = new int[numOfRunningDomain];
+                if (libVirt.virConnectListDomains(conn, runningDomainIDs, numOfRunningDomain) == -1)
+                {
+                    MessageBox.Show("Unable to list running domains", "List running domains failed", MessageBoxButtons.OK,
+                                    MessageBoxIcon.Error);
+                    return;
+                }
+
+                // Add the domain names to the listbox
+                foreach (int runningDomainID in runningDomainIDs)
+                {
+                    IntPtr domainPtr = libVirt.virDomainLookupByID(conn, runningDomainID);
+                    if (domainPtr == IntPtr.Zero)
+                    {
+                        MessageBox.Show("Unable to lookup domains by id", "Lookup domain failed", MessageBoxButtons.OK,
+                                    MessageBoxIcon.Error);
+                        return;
+                    }
+                    string domainName = libVirt.virDomainGetName(domainPtr);
+                    if (string.IsNullOrEmpty(domainName))
+                    {
+                        MessageBox.Show("Unable to get domain name", "Get domain name failed", MessageBoxButtons.OK,
+                                    MessageBoxIcon.Error);
+                        return;
+                    }
+                    lbDomains.Items.Add(domainName);
+                }
+                libVirt.virConnectClose(conn);
+            }
+            else
+            {
+                MessageBox.Show("Unable to connect", "Connection failed", MessageBoxButtons.OK, MessageBoxIcon.Error);
+            }
+        }
+
+        private static int AuthCallback(IntPtr creds, uint ncred, IntPtr cbdata)
+        {
+            // Get the AuthData structure
+            AuthData authData = (AuthData)Marshal.PtrToStructure(cbdata, typeof(AuthData));
+            int offset = 0;
+            int credIndex = 0;
+
+            while (credIndex < ncred)
+            {
+                IntPtr currentCred = new IntPtr(creds.ToInt32() + offset);
+
+                virConnectCredential cred = (virConnectCredential) Marshal.PtrToStructure(currentCred, typeof(virConnectCredential));
+                offset += Marshal.SizeOf(cred);
+                switch (cred.type)
+                {
+                    case virConnectCredentialType.VIR_CRED_AUTHNAME:
+                        // Fill the user name
+                        cred.Result = authData.user_name;
+                        cred.resultlen = (uint)authData.user_name.Length;
+                        break;
+                    case virConnectCredentialType.VIR_CRED_PASSPHRASE:
+                        // Fill the password
+                        cred.Result = authData.password;
+                        cred.resultlen = (uint)authData.password.Length;
+                        break;
+                    default:
+                        return -1;
+                }
+                // Write structure to the unmanaged address
+                Marshal.StructureToPtr(cred, currentCred, true);
+
+                credIndex++;
+            }
+            return 0;
+        }
+    }
+}
diff --git a/examples/VisualStudio/virConnectOpenAuth/Form1.resx b/examples/VisualStudio/virConnectOpenAuth/Form1.resx
new file mode 100644
index 0000000..1af7de1
--- /dev/null
+++ b/examples/VisualStudio/virConnectOpenAuth/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/virConnectOpenAuth/Program.cs b/examples/VisualStudio/virConnectOpenAuth/Program.cs
new file mode 100644
index 0000000..c11ba06
--- /dev/null
+++ b/examples/VisualStudio/virConnectOpenAuth/Program.cs
@@ -0,0 +1,28 @@
+﻿/*
+ * Copyright (C)
+ *   Arnaud Champion <arnaud.champion@devatom.fr>
+ *   Jaromír Červenka <cervajz@cervajz.com>
+ *
+ * See COPYING.LIB for the License of this software
+ */
+using System;
+using System.Collections.Generic;
+using System.Linq;
+using System.Windows.Forms;
+
+namespace virConnectOpenAuth
+{
+    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/virConnectOpenAuth/Properties/AssemblyInfo.cs b/examples/VisualStudio/virConnectOpenAuth/Properties/AssemblyInfo.cs
new file mode 100644
index 0000000..584ecd1
--- /dev/null
+++ b/examples/VisualStudio/virConnectOpenAuth/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("virConnectOpenAuth")]
+[assembly: AssemblyDescription("")]
+[assembly: AssemblyConfiguration("")]
+[assembly: AssemblyCompany("Microsoft")]
+[assembly: AssemblyProduct("virConnectOpenAuth")]
+[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("ba9903bd-9dd3-489f-b678-7ef7da81c27c")]
+
+// 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/virConnectOpenAuth/Properties/Resources.Designer.cs b/examples/VisualStudio/virConnectOpenAuth/Properties/Resources.Designer.cs
new file mode 100644
index 0000000..765fc5c
--- /dev/null
+++ b/examples/VisualStudio/virConnectOpenAuth/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 virConnectOpenAuth.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("virConnectOpenAuth.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/virConnectOpenAuth/Properties/Resources.resx b/examples/VisualStudio/virConnectOpenAuth/Properties/Resources.resx
new file mode 100644
index 0000000..af7dbeb
--- /dev/null
+++ b/examples/VisualStudio/virConnectOpenAuth/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/virConnectOpenAuth/Properties/Settings.Designer.cs b/examples/VisualStudio/virConnectOpenAuth/Properties/Settings.Designer.cs
new file mode 100644
index 0000000..d35d1ba
--- /dev/null
+++ b/examples/VisualStudio/virConnectOpenAuth/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 virConnectOpenAuth.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/virConnectOpenAuth/Properties/Settings.settings b/examples/VisualStudio/virConnectOpenAuth/Properties/Settings.settings
new file mode 100644
index 0000000..3964565
--- /dev/null
+++ b/examples/VisualStudio/virConnectOpenAuth/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/virConnectOpenAuth/virConnectOpenAuth.csproj b/examples/VisualStudio/virConnectOpenAuth/virConnectOpenAuth.csproj
new file mode 100644
index 0000000..6701c5f
--- /dev/null
+++ b/examples/VisualStudio/virConnectOpenAuth/virConnectOpenAuth.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>{F88B2E89-C3E6-4C69-881B-EB2AB4DE6CB3}</ProjectGuid>
+    <OutputType>WinExe</OutputType>
+    <AppDesignerFolder>Properties</AppDesignerFolder>
+    <RootNamespace>virConnectOpenAuth</RootNamespace>
+    <AssemblyName>virConnectOpenAuth</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/AssemblyInfo.cs b/projects/MonoDevelop/AssemblyInfo.cs
new file mode 100644
index 0000000..8786691
--- /dev/null
+++ b/projects/MonoDevelop/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("LibvirtBindings")]
+[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/projects/MonoDevelop/LibvirtBindings.csproj b/projects/MonoDevelop/LibvirtBindings.csproj
new file mode 100644
index 0000000..62d90e5
--- /dev/null
+++ b/projects/MonoDevelop/LibvirtBindings.csproj
@@ -0,0 +1,51 @@
+<?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>{C51C70EB-9040-4F8E-9A18-DF2A77D04A37}</ProjectGuid>
+    <OutputType>Library</OutputType>
+    <RootNamespace>LibvirtBindings</RootNamespace>
+    <AssemblyName>LibvirtBindings</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" />
+  </ItemGroup>
+  <ItemGroup>
+    <Compile Include="AssemblyInfo.cs" />
+    <Compile Include="..\..\Libvirt.cs">
+      <Link>Libvirt.cs</Link>
+    </Compile>
+    <Compile Include="..\..\LibvirtError.cs">
+      <Link>LibvirtError.cs</Link>
+    </Compile>
+    <Compile Include="..\..\LibvirtTypes.cs">
+      <Link>LibvirtTypes.cs</Link>
+    </Compile>
+    <Compile Include="..\..\StringWithoutNativeCleanUpMarshaler.cs">
+      <Link>StringWithoutNativeCleanUpMarshaler.cs</Link>
+    </Compile>
+  </ItemGroup>
+  <Import Project="$(MSBuildBinPath)\Microsoft.CSharp.targets" />
+</Project>
\ No newline at end of file
diff --git a/projects/MonoDevelop/LibvirtBindings.sln b/projects/MonoDevelop/LibvirtBindings.sln
new file mode 100644
index 0000000..135eaf3
--- /dev/null
+++ b/projects/MonoDevelop/LibvirtBindings.sln
@@ -0,0 +1,31 @@
+﻿
+Microsoft Visual Studio Solution File, Format Version 10.00
+# Visual Studio 2008
+Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "LibvirtBindings", "LibvirtBindings.csproj", "{C51C70EB-9040-4F8E-9A18-DF2A77D04A37}"
+EndProject
+Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "examples", "examples", "{504BA6A7-9D0E-44BA-827D-D797773347FD}"
+EndProject
+Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "virConnectOpenAuth", "..\..\examples\MonoDevelop\virConnectOpenAuth\virConnectOpenAuth.csproj", "{3259AE36-B12F-435E-9124-F6CAA781AD5C}"
+EndProject
+Global
+	GlobalSection(SolutionConfigurationPlatforms) = preSolution
+		Debug|Any CPU = Debug|Any CPU
+		Release|Any CPU = Release|Any CPU
+	EndGlobalSection
+	GlobalSection(ProjectConfigurationPlatforms) = postSolution
+		{3259AE36-B12F-435E-9124-F6CAA781AD5C}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
+		{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
+		{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
+		{C51C70EB-9040-4F8E-9A18-DF2A77D04A37}.Release|Any CPU.Build.0 = Release|Any CPU
+	EndGlobalSection
+	GlobalSection(NestedProjects) = preSolution
+		{3259AE36-B12F-435E-9124-F6CAA781AD5C} = {504BA6A7-9D0E-44BA-827D-D797773347FD}
+	EndGlobalSection
+	GlobalSection(MonoDevelopProperties) = preSolution
+		StartupItem = ..\..\examples\MonoDevelop\virConnectOpenAuth\virConnectOpenAuth.csproj
+	EndGlobalSection
+EndGlobal
diff --git a/projects/VisualStudio/LibvirtBindings.csproj b/projects/VisualStudio/LibvirtBindings.csproj
new file mode 100644
index 0000000..43990ba
--- /dev/null
+++ b/projects/VisualStudio/LibvirtBindings.csproj
@@ -0,0 +1,65 @@
+﻿<?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)' == '' ">AnyCPU</Platform>
+    <ProductVersion>8.0.30703</ProductVersion>
+    <SchemaVersion>2.0</SchemaVersion>
+    <ProjectGuid>{592FE0DB-C205-4934-BD20-79BDAB1584C1}</ProjectGuid>
+    <OutputType>Library</OutputType>
+    <AppDesignerFolder>Properties</AppDesignerFolder>
+    <RootNamespace>LibvirtBindings</RootNamespace>
+    <AssemblyName>LibvirtBindings</AssemblyName>
+    <TargetFrameworkVersion>v4.0</TargetFrameworkVersion>
+    <FileAlignment>512</FileAlignment>
+  </PropertyGroup>
+  <PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Debug|AnyCPU' ">
+    <DebugSymbols>true</DebugSymbols>
+    <DebugType>full</DebugType>
+    <Optimize>false</Optimize>
+    <OutputPath>bin\Debug\</OutputPath>
+    <DefineConstants>TRACE;DEBUG;WINDOWS</DefineConstants>
+    <ErrorReport>prompt</ErrorReport>
+    <WarningLevel>4</WarningLevel>
+  </PropertyGroup>
+  <PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Release|AnyCPU' ">
+    <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.Xml" />
+  </ItemGroup>
+  <ItemGroup>
+    <Compile Include="..\..\Libvirt.cs">
+      <Link>Libvirt.cs</Link>
+    </Compile>
+    <Compile Include="..\..\LibvirtError.cs">
+      <Link>LibvirtError.cs</Link>
+    </Compile>
+    <Compile Include="..\..\LibvirtTypes.cs">
+      <Link>LibvirtTypes.cs</Link>
+    </Compile>
+    <Compile Include="..\..\StringWithoutNativeCleanUpMarshaler.cs">
+      <Link>StringWithoutNativeCleanUpMarshaler.cs</Link>
+    </Compile>
+    <Compile Include="Properties\AssemblyInfo.cs" />
+  </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/VisualStudio/LibvirtBindings.sln b/projects/VisualStudio/LibvirtBindings.sln
new file mode 100644
index 0000000..e167b62
--- /dev/null
+++ b/projects/VisualStudio/LibvirtBindings.sln
@@ -0,0 +1,47 @@
+﻿
+Microsoft Visual Studio Solution File, Format Version 11.00
+# Visual Studio 2010
+Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "LibvirtBindings", "LibvirtBindings.csproj", "{592FE0DB-C205-4934-BD20-79BDAB1584C1}"
+EndProject
+Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "examples", "examples", "{AB0DC218-8ABA-4351-AD87-361AF7AF71C9}"
+EndProject
+Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "virConnectOpenAuth", "..\..\examples\VisualStudio\virConnectOpenAuth\virConnectOpenAuth.csproj", "{F88B2E89-C3E6-4C69-881B-EB2AB4DE6CB3}"
+EndProject
+Global
+	GlobalSection(SolutionConfigurationPlatforms) = preSolution
+		Debug|Any CPU = Debug|Any CPU
+		Debug|Mixed Platforms = Debug|Mixed Platforms
+		Debug|x86 = Debug|x86
+		Release|Any CPU = Release|Any CPU
+		Release|Mixed Platforms = Release|Mixed Platforms
+		Release|x86 = Release|x86
+	EndGlobalSection
+	GlobalSection(ProjectConfigurationPlatforms) = postSolution
+		{592FE0DB-C205-4934-BD20-79BDAB1584C1}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
+		{592FE0DB-C205-4934-BD20-79BDAB1584C1}.Debug|Any CPU.Build.0 = Debug|Any CPU
+		{592FE0DB-C205-4934-BD20-79BDAB1584C1}.Debug|Mixed Platforms.ActiveCfg = Debug|Any CPU
+		{592FE0DB-C205-4934-BD20-79BDAB1584C1}.Debug|Mixed Platforms.Build.0 = Debug|Any CPU
+		{592FE0DB-C205-4934-BD20-79BDAB1584C1}.Debug|x86.ActiveCfg = Debug|Any CPU
+		{592FE0DB-C205-4934-BD20-79BDAB1584C1}.Release|Any CPU.ActiveCfg = Release|Any CPU
+		{592FE0DB-C205-4934-BD20-79BDAB1584C1}.Release|Any CPU.Build.0 = Release|Any CPU
+		{592FE0DB-C205-4934-BD20-79BDAB1584C1}.Release|Mixed Platforms.ActiveCfg = Release|Any CPU
+		{592FE0DB-C205-4934-BD20-79BDAB1584C1}.Release|Mixed Platforms.Build.0 = Release|Any CPU
+		{592FE0DB-C205-4934-BD20-79BDAB1584C1}.Release|x86.ActiveCfg = Release|Any CPU
+		{F88B2E89-C3E6-4C69-881B-EB2AB4DE6CB3}.Debug|Any CPU.ActiveCfg = Debug|x86
+		{F88B2E89-C3E6-4C69-881B-EB2AB4DE6CB3}.Debug|Mixed Platforms.ActiveCfg = Debug|x86
+		{F88B2E89-C3E6-4C69-881B-EB2AB4DE6CB3}.Debug|Mixed Platforms.Build.0 = Debug|x86
+		{F88B2E89-C3E6-4C69-881B-EB2AB4DE6CB3}.Debug|x86.ActiveCfg = Debug|x86
+		{F88B2E89-C3E6-4C69-881B-EB2AB4DE6CB3}.Debug|x86.Build.0 = Debug|x86
+		{F88B2E89-C3E6-4C69-881B-EB2AB4DE6CB3}.Release|Any CPU.ActiveCfg = Release|x86
+		{F88B2E89-C3E6-4C69-881B-EB2AB4DE6CB3}.Release|Mixed Platforms.ActiveCfg = Release|x86
+		{F88B2E89-C3E6-4C69-881B-EB2AB4DE6CB3}.Release|Mixed Platforms.Build.0 = Release|x86
+		{F88B2E89-C3E6-4C69-881B-EB2AB4DE6CB3}.Release|x86.ActiveCfg = Release|x86
+		{F88B2E89-C3E6-4C69-881B-EB2AB4DE6CB3}.Release|x86.Build.0 = Release|x86
+	EndGlobalSection
+	GlobalSection(SolutionProperties) = preSolution
+		HideSolutionNode = FALSE
+	EndGlobalSection
+	GlobalSection(NestedProjects) = preSolution
+		{F88B2E89-C3E6-4C69-881B-EB2AB4DE6CB3} = {AB0DC218-8ABA-4351-AD87-361AF7AF71C9}
+	EndGlobalSection
+EndGlobal
diff --git a/projects/VisualStudio/Properties/AssemblyInfo.cs b/projects/VisualStudio/Properties/AssemblyInfo.cs
new file mode 100644
index 0000000..a31b02e
--- /dev/null
+++ b/projects/VisualStudio/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("LibvirtBindings")]
+[assembly: AssemblyDescription("")]
+[assembly: AssemblyConfiguration("")]
+[assembly: AssemblyCompany("")]
+[assembly: AssemblyProduct("LibvirtBindings")]
+[assembly: AssemblyCopyright("")]
+[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("293dffa5-843d-4a4e-9cd2-7fe1194cee18")]
+
+// 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")]
-- 
1.7.2.3.msysgit.0

