Index: extensions/PiwigoLib/PiwigoLib/DTO/Helper/PwgEnumHelper.cs
===================================================================
--- extensions/PiwigoLib/PiwigoLib/DTO/Helper/PwgEnumHelper.cs	(revision 7160)
+++ extensions/PiwigoLib/PiwigoLib/DTO/Helper/PwgEnumHelper.cs	(revision 11850)
@@ -1,8 +1,4 @@
 ﻿using System;
-using System.Collections.Generic;
-using System.Linq;
-using System.Text;
 using System.Reflection;
-using System.ComponentModel;
 using System.Xml.Serialization;
 
@@ -11,5 +7,12 @@
     internal static class PwgEnumHelper<T>
     {
-        internal static string stringValueOf(T value)
+        static PwgEnumHelper()
+        {
+            if (!typeof(T).IsEnum) {
+                throw new ArgumentException(String.Format("PwgEnumHelper<T>(): The type {0} is not a enum.", typeof(T).Name));
+            }
+        }
+
+        internal static String StringValueOf(T value)
         {
             FieldInfo fi = value.GetType().GetField(value.ToString());
@@ -25,5 +28,5 @@
         }
 
-        internal static T enumValueOf(string value)
+        internal static T enumValueOf(String value) 
         {
             Type enumType = typeof(T);
@@ -31,5 +34,5 @@
             foreach (T enumValue in values)
             {
-                if (stringValueOf(enumValue).Equals(value))
+                if (StringValueOf(enumValue).Equals(value))
                 {
                     return enumValue;
@@ -37,5 +40,5 @@
             }
 
-            throw new ArgumentException("The string is not a description or value of the specified enum.");
+            throw new ArgumentException(String.Format("PwgEnumHelper<{0}>.enumValueOf({1}): The String is not a description or value of the specified enum.", typeof(T).Name, value));
         }
     }
Index: extensions/PiwigoLib/PiwigoLib/DTO/PwgCategory.cs
===================================================================
--- extensions/PiwigoLib/PiwigoLib/DTO/PwgCategory.cs	(revision 7160)
+++ extensions/PiwigoLib/PiwigoLib/DTO/PwgCategory.cs	(revision 11850)
@@ -1,5 +1,4 @@
 ﻿using System;
 using System.Collections.Generic;
-using System.Text;
 
 
@@ -9,4 +8,6 @@
     public class PwgCategory
     {
+        public static Int32 RootCategoryId = 0;
+
         public Int32        Id { get; set; }
         public List<Int32>  UpperCategoriesId { get; set; }
Index: extensions/PiwigoLib/PiwigoLib/DTO/PwgImage.cs
===================================================================
--- extensions/PiwigoLib/PiwigoLib/DTO/PwgImage.cs	(revision 7160)
+++ extensions/PiwigoLib/PiwigoLib/DTO/PwgImage.cs	(revision 11850)
@@ -1,5 +1,4 @@
 ﻿using System;
 using System.Collections.Generic;
-using System.Text;
 
 
Index: extensions/PiwigoLib/PiwigoLib/DTO/PwgServiceException.cs
===================================================================
--- extensions/PiwigoLib/PiwigoLib/DTO/PwgServiceException.cs	(revision 7160)
+++ extensions/PiwigoLib/PiwigoLib/DTO/PwgServiceException.cs	(revision 11850)
@@ -1,7 +1,3 @@
 ﻿using System;
-using System.Collections.Generic;
-using System.Linq;
-using System.Text;
-using Com.Piwigo.Lib.IService;
 
 namespace Com.Piwigo.Lib.DTO
Index: extensions/PiwigoLib/PiwigoLib/DTO/PwgSession.cs
===================================================================
--- extensions/PiwigoLib/PiwigoLib/DTO/PwgSession.cs	(revision 7160)
+++ extensions/PiwigoLib/PiwigoLib/DTO/PwgSession.cs	(revision 11850)
@@ -1,5 +1,3 @@
 ﻿using System;
-using System.Collections.Generic;
-using System.Text;
 
 
@@ -18,5 +16,6 @@
         public String Theme                 { get; set; }
         public String Language              { get; set; }
-        public String CharSet               { get; set; }    
+        public String CharSet               { get; set; }
+        public String SecurityToken         { get; set; }    
     }
 }
Index: extensions/PiwigoLib/PiwigoLib/DTO/PwgSessionStatusEnum.cs
===================================================================
--- extensions/PiwigoLib/PiwigoLib/DTO/PwgSessionStatusEnum.cs	(revision 7160)
+++ extensions/PiwigoLib/PiwigoLib/DTO/PwgSessionStatusEnum.cs	(revision 11850)
@@ -1,6 +1,3 @@
 ﻿using System;
-using System.Collections.Generic;
-using System.Linq;
-using System.Text;
 using System.Xml.Serialization;
 
Index: extensions/PiwigoLib/PiwigoLib/DTO/PwgTag.cs
===================================================================
--- extensions/PiwigoLib/PiwigoLib/DTO/PwgTag.cs	(revision 7160)
+++ extensions/PiwigoLib/PiwigoLib/DTO/PwgTag.cs	(revision 11850)
@@ -1,5 +1,3 @@
 ﻿using System;
-using System.Collections.Generic;
-using System.Text;
 
 
Index: extensions/PiwigoLib/PiwigoLib/IService/IPwgCategoriesService.cs
===================================================================
--- extensions/PiwigoLib/PiwigoLib/IService/IPwgCategoriesService.cs	(revision 7160)
+++ extensions/PiwigoLib/PiwigoLib/IService/IPwgCategoriesService.cs	(revision 11850)
@@ -4,9 +4,11 @@
     public interface IPwgCategoriesService
     {
-        bool AddCategory(string categoryName, int? upperCatId, ref int newId, ref string messageInfo);
+        Boolean AddCategory(String categoryName, Int32? upperCatId, ref Int32 newId, ref String messageInfo);
         System.Collections.Generic.List<Com.Piwigo.Lib.DTO.PwgCategory> GetAdminListOfCategory();
-        System.Collections.Generic.List<Com.Piwigo.Lib.DTO.PwgCategory> GetListOfCategory(int? CatgeroryId, bool? Recursive, bool? PublicOnly);
-        System.Collections.Generic.List<Com.Piwigo.Lib.DTO.PwgImage> GetListOfImagesFormCategory(int categoryId, bool? recursive, int? perPage, int? Page, int? Order, int? minRate, int? maxRate, int? minHit, int? maxHit, DateTime? minDateAvailable, DateTime? maxDateAvailable, DateTime? minDateCreated, DateTime? maxDateCreated, int? minRatio, int? maxRatio, bool? withThumbnail, ref int PageReturned, ref int PerPageeReturned, ref int CountReturned);
-        bool UpdateCategoryInfo(int IdCat, string categoryName, string categoryComment);
+        System.Collections.Generic.List<Com.Piwigo.Lib.DTO.PwgCategory> GetListOfCategory(Int32? CatgeroryId, Boolean? Recursive, Boolean? PublicOnly);
+        System.Collections.Generic.List<Com.Piwigo.Lib.DTO.PwgImage> GetListOfImagesFormCategory(Int32 categoryId, Boolean? recursive, Int32? perPage, Int32? Page, Int32? Order, Int32? minRate, Int32? maxRate, Int32? minHit, Int32? maxHit, DateTime? minDateAvailable, DateTime? maxDateAvailable, DateTime? minDateCreated, DateTime? maxDateCreated, Int32? minRatio, Int32? maxRatio, Boolean? withThumbnail, ref Int32 PageReturned, ref Int32 PerPageeReturned, ref Int32 CountReturned);
+        Boolean UpdateCategoryInfo(Int32 IdCat, String categoryName, String categoryComment);
+        Boolean DeleteCategory(Int32 categoryId, String SecurityToken, Com.Piwigo.Lib.DTO.PwgCategoryPhotoDeletionModeEnum PhotoDeletionMode);
+        Boolean MoveCategory(System.Collections.Generic.List<Int32> categoriesId, Int32 parentCategoryId, String SecurityToken);
     }
 }
Index: extensions/PiwigoLib/PiwigoLib/IService/IPwgImagesService.cs
===================================================================
--- extensions/PiwigoLib/PiwigoLib/IService/IPwgImagesService.cs	(revision 7160)
+++ extensions/PiwigoLib/PiwigoLib/IService/IPwgImagesService.cs	(revision 11850)
@@ -4,5 +4,6 @@
     public interface IPwgImagesService
     {
-        Com.Piwigo.Lib.DTO.PwgImageRate RateImage(int imageId, int imageRate);
+        Com.Piwigo.Lib.DTO.PwgImageRate RateImage(Int32 imageId, Int32 imageRate);
+        Boolean addImageByMultiPartForm(System.IO.FileInfo fileImage, Int32? imageId, Int32? categoryId, String imageName, String imageAuthor, String imageComment, Int32? imageLevel, String imageTags);
     }
 }
Index: extensions/PiwigoLib/PiwigoLib/IService/IPwgSessionService.cs
===================================================================
--- extensions/PiwigoLib/PiwigoLib/IService/IPwgSessionService.cs	(revision 7160)
+++ extensions/PiwigoLib/PiwigoLib/IService/IPwgSessionService.cs	(revision 11850)
@@ -5,5 +5,5 @@
     {
         Com.Piwigo.Lib.DTO.PwgSession GetPwgSession();
-        Com.Piwigo.Lib.DTO.PwgSession Login(string UserName, string Password);
+        Com.Piwigo.Lib.DTO.PwgSession Login(String UserName, String Password);
         Com.Piwigo.Lib.DTO.PwgSession Logout();
     }
Index: extensions/PiwigoLib/PiwigoLib/IService/IPwgSetupService.cs
===================================================================
--- extensions/PiwigoLib/PiwigoLib/IService/IPwgSetupService.cs	(revision 7160)
+++ extensions/PiwigoLib/PiwigoLib/IService/IPwgSetupService.cs	(revision 11850)
@@ -4,5 +4,5 @@
     public interface IPwgSetupService
     {
-        void Setup(string PwgUserAgent, short? PwgTimeOutInSecond, Uri serverURI);
+        void Setup(String PwgUserAgent, Int16? PwgTimeOutInSecond, Uri serverURI);
     }
 }
Index: extensions/PiwigoLib/PiwigoLib/IService/IPwgTagsService.cs
===================================================================
--- extensions/PiwigoLib/PiwigoLib/IService/IPwgTagsService.cs	(revision 7160)
+++ extensions/PiwigoLib/PiwigoLib/IService/IPwgTagsService.cs	(revision 11850)
@@ -4,8 +4,8 @@
     public interface IPwgTagsService
     {
-        bool AddTag(string tagName, ref int newId, ref string messageInfo);
+        Boolean AddTag(String tagName, ref Int32 newId, ref String messageInfo);
         System.Collections.Generic.List<Com.Piwigo.Lib.DTO.PwgTag> GetAdminListOfTag();
-        System.Collections.Generic.List<Com.Piwigo.Lib.DTO.PwgImage> GetListOfImagesFormTags(System.Collections.Generic.List<int> tagsId, System.Collections.Generic.List<string> tagsUrlName, System.Collections.Generic.List<string> tagsName, bool? tagModeAnd, int? perPage, int? Page, int? Order, int? minRate, int? maxRate, int? minHit, int? maxHit, DateTime? minDateAvailable, DateTime? maxDateAvailable, DateTime? minDateCreated, DateTime? maxDateCreated, int? minRatio, int? maxRatio, bool? withThumbnail, ref int PageReturned, ref int PerPageeReturned, ref int CountReturned);
-        System.Collections.Generic.List<Com.Piwigo.Lib.DTO.PwgTag> GetListOfTag(bool? sortedByCounter);
+        System.Collections.Generic.List<Com.Piwigo.Lib.DTO.PwgImage> GetListOfImagesFormTags(System.Collections.Generic.List<Int32> tagsId, System.Collections.Generic.List<String> tagsUrlName, System.Collections.Generic.List<String> tagsName, Boolean? tagModeAnd, Int32? perPage, Int32? Page, Int32? Order, Int32? minRate, Int32? maxRate, Int32? minHit, Int32? maxHit, DateTime? minDateAvailable, DateTime? maxDateAvailable, DateTime? minDateCreated, DateTime? maxDateCreated, Int32? minRatio, Int32? maxRatio, Boolean? withThumbnail, ref Int32 PageReturned, ref Int32 PerPageeReturned, ref Int32 CountReturned);
+        System.Collections.Generic.List<Com.Piwigo.Lib.DTO.PwgTag> GetListOfTag(Boolean? sortedByCounter);
     }
 }
Index: extensions/PiwigoLib/PiwigoLib/PiwigoLib.csproj
===================================================================
--- extensions/PiwigoLib/PiwigoLib/PiwigoLib.csproj	(revision 7160)
+++ extensions/PiwigoLib/PiwigoLib/PiwigoLib.csproj	(revision 11850)
@@ -51,4 +51,5 @@
   </ItemGroup>
   <ItemGroup>
+    <Compile Include="DTO\PwgCategoryPhotoDeletionModeEnum.cs" />
     <Compile Include="DTO\PwgCategory.cs" />
     <Compile Include="DTO\PwgImage.cs" />
Index: extensions/PiwigoLib/PiwigoLib/Proxy/Helper/PwgProxyReponseHelper.cs
===================================================================
--- extensions/PiwigoLib/PiwigoLib/Proxy/Helper/PwgProxyReponseHelper.cs	(revision 7160)
+++ extensions/PiwigoLib/PiwigoLib/Proxy/Helper/PwgProxyReponseHelper.cs	(revision 11850)
@@ -4,4 +4,6 @@
 using System.Text;
 using System.Web;
+
+using Com.Piwigo.Lib.DTO.Helper;
 
 namespace Com.Piwigo.Lib.Proxy.Helper
@@ -48,4 +50,6 @@
         {
             String FormatString = String.Empty;
+            String ParamValue = String.Empty;
+            
             if (value != null)
             {
@@ -56,5 +60,15 @@
                 }
 
-                queryStringBuilder.AppendFormat(FormatString, paramName, HttpUtility.UrlEncode(value.ToString().ToLower()));
+                if (typeof(T).IsEnum)
+                {
+                    ParamValue = HttpUtility.UrlEncode(PwgEnumHelper<T>.StringValueOf(value));
+                }
+                else
+                {
+                    ParamValue = HttpUtility.UrlEncode(value.ToString().ToLower());
+                }
+                
+                queryStringBuilder.AppendFormat(FormatString, paramName, ParamValue);
+                
                 firstOcc = false;
             }
Index: extensions/PiwigoLib/PiwigoLib/Proxy/PwgCategoriesProxy.cs
===================================================================
--- extensions/PiwigoLib/PiwigoLib/Proxy/PwgCategoriesProxy.cs	(revision 7160)
+++ extensions/PiwigoLib/PiwigoLib/Proxy/PwgCategoriesProxy.cs	(revision 11850)
@@ -10,4 +10,13 @@
 namespace Com.Piwigo.Lib.Proxy
 {
+    /// <summary>
+    /// pwg.categories.add              pwg_categories_add
+    /// pwg.categories.delete           pwg_categories_delete
+    /// pwg.categories.getAdminList     pwg_categories_getAdminList
+    /// pwg.categories.getImages        pwg_categories_getImages
+    /// pwg.categories.getList          pwg_categories_getList
+    /// pwg.categories.move             pwg_categories_move
+    /// pwg.categories.setInfo          pwg_categories_setInfo
+    /// </summary>
     static internal class PwgCategoriesProxy
     {
@@ -200,29 +209,63 @@
 
         /// <summary>
-        /// 
-        /// </summary>
-        /// <param name="tagName"></param>
-        /// <returns></returns>
-        static internal PwgAddRequestProxyResponse pwg_tag_add(string tagName)
-        {
-            PwgAddRequestProxyResponse response = null;
-            try
-            {
-                StringBuilder data = new StringBuilder();
-                data.Append("method=pwg.tags.add");
-                data.Append("&name=" + HttpUtility.UrlEncode(tagName));
-
-                response = PwgGenericProxy<PwgAddRequestProxyResponse>.Post(
-                    PwgConfigProxy.PwgServeurUri,
-                    data.ToString());
-            }
-            catch (Exception ex)
-            {
-                throw new PwgProxyException("pwg_tag_add", ex);
-            }
-
-            return response;
-        }
-
+        /// pwg.categories.delete
+        /// </summary>
+        /// <param name="CategorysId"></param>
+        /// <param name="SecurityToken"></param>
+        /// <param name="PhotoDeletionMode"></param>
+        /// <returns></returns>
+        static internal PwgBaseProxyReponse pwg_categories_delete(Int32 CategoryId,
+                                                                  String SecurityToken,
+                                                                  PwgCategoryPhotoDeletionModeEnum PhotoDeletionMode)
+        {
+            PwgBaseProxyReponse response = null;
+            try
+            {
+                StringBuilder data = new StringBuilder();
+                Boolean firstOcc = true;
+                data.Append("method=pwg.categories.delete");
+                firstOcc = false;
+                PwgProxyReponseHelper.buildQueryFromValue<Int32>(CategoryId, "category_id", ref firstOcc, data);
+                PwgProxyReponseHelper.buildQueryFromValue<String>(SecurityToken, "pwg_token", ref firstOcc, data);
+                PwgProxyReponseHelper.buildQueryFromValue<PwgCategoryPhotoDeletionModeEnum>(PhotoDeletionMode, "photo_deletion_mode", ref firstOcc, data);
+
+                response = PwgGenericProxy<PwgBaseProxyReponse>.Post(
+                                PwgConfigProxy.PwgServeurUri,
+                                data.ToString());
+            }
+            catch (Exception ex)
+            {
+                throw new PwgProxyException("pwg_categories_delete", ex);
+            }
+
+            return response;
+        }
+
+        static internal PwgBaseProxyReponse pwg_categories_move(List<Int32> CategoriesId,
+                                                                Int32 ParentCategoryId,
+                                                                String SecurityToken)
+        {
+            PwgBaseProxyReponse response = null;
+            try
+            {
+                StringBuilder data = new StringBuilder();
+                Boolean firstOcc = true;
+                data.Append("method=pwg.categories.move");
+                firstOcc = false;
+                PwgProxyReponseHelper.buildQueryFromArray<Int32>(CategoriesId, "category_id", ref firstOcc, data);
+                PwgProxyReponseHelper.buildQueryFromValue<Int32>(ParentCategoryId, "parent", ref firstOcc, data);
+                PwgProxyReponseHelper.buildQueryFromValue<String>(SecurityToken, "pwg_token", ref firstOcc, data);
+
+                response = PwgGenericProxy<PwgBaseProxyReponse>.Post(
+                                PwgConfigProxy.PwgServeurUri,
+                                data.ToString());
+            }
+            catch (Exception ex)
+            {
+                throw new PwgProxyException("pwg_categories_delete", ex);
+            }
+
+            return response;
+        }
     }
 
Index: extensions/PiwigoLib/PiwigoLib/Proxy/PwgConfigProxy.cs
===================================================================
--- extensions/PiwigoLib/PiwigoLib/Proxy/PwgConfigProxy.cs	(revision 7160)
+++ extensions/PiwigoLib/PiwigoLib/Proxy/PwgConfigProxy.cs	(revision 11850)
@@ -1,6 +1,3 @@
 ﻿using System;
-using System.Collections.Generic;
-using System.Linq;
-using System.Text;
 using System.Net;
 
Index: extensions/PiwigoLib/PiwigoLib/Proxy/PwgGenericProxy.cs
===================================================================
--- extensions/PiwigoLib/PiwigoLib/Proxy/PwgGenericProxy.cs	(revision 7160)
+++ extensions/PiwigoLib/PiwigoLib/Proxy/PwgGenericProxy.cs	(revision 11850)
@@ -8,4 +8,5 @@
 using System.Xml.Serialization;
 using System.Xml;
+using System.Collections.Specialized;
 
 namespace Com.Piwigo.Lib.Proxy
@@ -14,5 +15,11 @@
     static internal class PwgGenericProxy<T>
     {
-
+        /// <summary>
+        /// Send Get data request to piwigo
+        /// </summary>
+        /// <param name="address"></param>
+        /// <param name="methodName"></param>
+        /// <param name="methodParameter"></param>
+        /// <returns></returns>
         internal static T Get(Uri address, String methodName, String methodParameter)
         {
@@ -77,4 +84,10 @@
         }
 
+        /// <summary>
+        /// Send Post data request to piwigo
+        /// </summary>
+        /// <param name="address"></param>
+        /// <param name="data"></param>
+        /// <returns></returns>
         internal static T Post(Uri address, String data)
         {
@@ -144,14 +157,186 @@
         }
 
+        private class MimePart
+        {
+            internal NameValueCollection Headers { get; set; }
+            internal byte[] Header { get; set; }
+            internal Stream Data { get; set; }
+
+            internal MimePart()
+            {
+                Headers = new NameValueCollection();
+            }
+        }
+        /// <summary>
+        /// 
+        /// </summary>
+        /// <param name="address">URI of server</param>
+        /// <param name="dcFiles">Dictionary(String NameOfFileFiel, String FilePath) FilePath must exist on hdd</param>
+        /// <param name="dcFields">Dictionary(String NameOfFormField, String ValueForField) others form filed to submit</param>
+        /// <returns></returns>
+        internal static T PostAsMultiPartForm(Uri address, Dictionary<String, String> dcFiles, Dictionary<String, String> dcFields)
+        {            
+            List<MimePart> lstMimeParts = new List<MimePart>();
+            T ReturnValue = default(T);
+
+            HttpWebRequest Request;
+            HttpWebResponse Response = null;
+            
+            if (address == null) { throw new PwgProxyException("The get address is null."); }
+
+            try
+            {
+                // Create the web request  
+                Request = WebRequest.Create(address) as HttpWebRequest;
+                Request.UserAgent = PwgConfigProxy.PwgUserAgent;
+                Request.KeepAlive = PwgConfigProxy.PwgKeepAlive;
+                Request.Timeout = PwgConfigProxy.PwgTimeOutInSecond * 1000;
+                Request.CookieContainer = PwgConfigProxy.cookieContainer; // get session cookie        
+
+                // MultiPart Post Request
+                Request.ContentType = "multipart/form-data;";
+                Request.Method = "POST";
+
+                // Loading Mine Part data from others form fields
+                foreach (string key in dcFields.Keys)
+                {
+                    MimePart part = new MimePart();
+                    part.Headers["Content-Disposition"] = "form-data; name=\"" + key + "\"";
+                    part.Data = new MemoryStream(Encoding.UTF8.GetBytes(dcFields[key]));
+                    lstMimeParts.Add(part);
+                }
+
+                // Loading MinePart data from form file fields
+                foreach (String strFieldName in dcFiles.Keys)
+                {
+                    MimePart part = new MimePart();
+                    part.Headers["Content-Disposition"] = "form-data; name=\"" + strFieldName + "\"; filename=\"" + dcFiles[strFieldName] + "\"";
+                    part.Headers["Content-Type"] = "application/octet-stream";
+                    part.Data = File.OpenRead(dcFiles[strFieldName]); // Open file for getting a stream reader on it.
+                    lstMimeParts.Add(part);
+                }
+
+                string strBound = "----------" + DateTime.Now.Ticks.ToString("x");
+                byte[] strFooter = Encoding.UTF8.GetBytes("--" + strBound + "--\r\n");
+                Request.ContentType += " boundary=" + strBound;
+
+                long contentLength = 0;
+                foreach (MimePart part in lstMimeParts)
+                {                   
+                    StringBuilder sb = new StringBuilder();
+
+                    sb.Append("--");
+                    sb.Append(strBound);
+                    sb.AppendLine();
+                    foreach (string key in part.Headers.AllKeys)
+                    {
+                        sb.Append(key);
+                        sb.Append(": ");
+                        sb.AppendLine(part.Headers[key]);
+                    }
+                    sb.AppendLine();
+
+                    part.Header = Encoding.UTF8.GetBytes(sb.ToString());
+
+                    contentLength += part.Header.Length + part.Data.Length + 2;
+
+                }
+
+                Request.ContentLength = contentLength + strFooter.Length;
+
+                byte[] buffer = new byte[8192];
+                byte[] afterFile = Encoding.UTF8.GetBytes("\r\n");
+                int read;
+
+                using (Stream s = Request.GetRequestStream())
+                {
+                    foreach (MimePart part in lstMimeParts)
+                    {
+                        s.Write(part.Header, 0, part.Header.Length);
+
+                        while ((read = part.Data.Read(buffer, 0, buffer.Length)) > 0)
+                            s.Write(buffer, 0, read);
+
+                        part.Data.Close();
+                        part.Data.Dispose();
+
+                        s.Write(afterFile, 0, afterFile.Length);
+                    }
+
+                    s.Write(strFooter, 0, strFooter.Length);
+                }
+
+                // Get response  
+                using (Response = Request.GetResponse() as HttpWebResponse)
+                {
+                    // Get the response stream  
+                    StreamReader reader = new StreamReader(Response.GetResponseStream());
+
+                    ReturnValue = DeserializeObject(reader);
+                }
+            }
+            catch (WebException wex)
+            {
+                // This exception will be raised if the server didn't return 200 - OK  
+                // Try to retrieve more information about the network error  
+                if (wex.Response != null)
+                {
+                    using (HttpWebResponse ErrorResponse = (HttpWebResponse)wex.Response)
+                    {
+                        throw new PwgProxyException(
+                            String.Format(
+                                "The server returned '{0}' with the status code {1} ({2:d}).",
+                                ErrorResponse.StatusDescription, ErrorResponse.StatusCode,
+                                ErrorResponse.StatusCode),
+                            wex);
+                    }
+                }
+            }
+            catch (IOException ioex)
+            {
+                // This exception will be raised if file aren't ok on client
+                if (ioex!= null)
+                {
+                        throw new PwgProxyException(
+                            String.Format(
+                                "A IO file exception stop the request building : {0}.", ioex.Message),
+                            ioex);
+                }
+            }
+            finally
+            {
+                if (Response != null) { Response.Close(); }
+                foreach (MimePart part in lstMimeParts)
+                {
+                    if (part.Data != null)
+                        part.Data.Dispose();
+                }
+            }
+            return ReturnValue;
+        }
+    
+        /// <summary>
+        ///  return object from xml retuned by piwigo
+        /// </summary>
+        /// <param name="xmlData"></param>
+        /// <returns></returns>
         internal static T DeserializeObject(StreamReader xmlData)
         {
             T ReturnValue = default(T);
-
-            try
-            {
-                //Console.WriteLine(xmlData.ReadToEnd());
-
+            String line = String.Empty;
+            try
+            {
+#if DEBUG
+                line = xmlData.ReadToEnd();
+                System.Diagnostics.Debug.WriteLine(line);
+
+                byte[] hexLine = System.Text.Encoding.UTF8.GetBytes(line);
+                MemoryStream m = new System.IO.MemoryStream(hexLine);
+                StreamReader xmlDat = new StreamReader(m);
+#else
+                xmlDat = xmlData;
+#endif
                 System.Xml.Serialization.XmlSerializer xsSerializer = new System.Xml.Serialization.XmlSerializer(typeof(T));
-                ReturnValue = (T)xsSerializer.Deserialize(xmlData);
+                ReturnValue = (T)xsSerializer.Deserialize(xmlDat);
             }
             catch (Exception ex)
@@ -160,5 +345,5 @@
                             String.Format(
                                 "The value {0} can't be deserialized in {1}, the error is {2} .",
-                                xmlData, typeof(T).Name, ex.Message),
+                                line, typeof(T).Name, ex.Message),
                             ex);
             }
Index: extensions/PiwigoLib/PiwigoLib/Proxy/PwgImagesProxy.cs
===================================================================
--- extensions/PiwigoLib/PiwigoLib/Proxy/PwgImagesProxy.cs	(revision 7160)
+++ extensions/PiwigoLib/PiwigoLib/Proxy/PwgImagesProxy.cs	(revision 11850)
@@ -7,4 +7,5 @@
 using Com.Piwigo.Lib.Proxy.Response;
 using Com.Piwigo.Lib.Proxy.Helper;
+using System.IO;
 
 namespace Com.Piwigo.Lib.Proxy
@@ -12,4 +13,23 @@
     static internal class PwgImagesProxy
     {
+
+        /*
+         * pwg.images.add
+         * pwg.images.addChunk
+         * pwg.images.addComment
+         * pwg.images.addFile
+         * pwg.images.addSimple
+         * pwg.images.checkFiles
+         * pwg.images.checkUpload
+         * pwg.images.delete
+         * pwg.images.exist
+         * pwg.images.getInfo
+         * pwg.images.rate                  pwg_images_rate
+         * pwg.images.regenerateThumbnail
+         * pwg.images.search
+         * pwg.images.setInfo
+         * pwg.images.setPrivacyLevel
+ * */
+
         /// <summary>
         /// pwg.images.rate
@@ -41,4 +61,40 @@
         }
 
+        static internal PwgBaseProxyReponse pwg_images_addSimple(FileInfo fileImage, Int32? imageId, Int32? categoryId, String imageName, String imageAuthor, String imageComment, Int32? imageLevel, String imageTags)
+        {
+            PwgBaseProxyReponse response = null;
+
+            Dictionary<String, String> dcFiles  = new Dictionary<string,string>();
+            Dictionary<String, String> dcFields = new Dictionary<string,string>();
+            
+            try
+            {
+                dcFields.Add("method", "pwg.images.addSimple");
+                if (imageId.HasValue) { dcFields.Add("image_id", imageId.Value.ToString()); }
+                if (categoryId.HasValue) { dcFields.Add("category", categoryId.Value.ToString()); }
+                if (imageLevel.HasValue) { dcFields.Add("level", imageLevel.Value.ToString()); }
+                if (!String.IsNullOrEmpty(imageName)) { dcFields.Add("name", imageName); }
+                if (!String.IsNullOrEmpty(imageAuthor)) { dcFields.Add("author", imageAuthor); }
+                if (!String.IsNullOrEmpty(imageComment)) { dcFields.Add("comment", imageComment); }
+                if (!String.IsNullOrEmpty(imageTags)) { dcFields.Add("tags", imageTags); }
+
+                if ((fileImage != null) && (fileImage.Exists)) 
+                {
+                    dcFiles.Add("image", fileImage.FullName); 
+                }
+                else
+                {
+                    throw new PwgProxyException("pwg_images_addSimple : no file or wrong file info provided for fileImage");
+                }
+
+                response = PwgGenericProxy<PwgBaseProxyReponse>.PostAsMultiPartForm(PwgConfigProxy.PwgServeurUri, dcFiles, dcFields);            
+            }
+            catch (Exception ex)
+            {
+                throw new PwgProxyException("pwg_images_addSimple", ex);
+            }
+
+            return response;
+        }
     }
 
Index: extensions/PiwigoLib/PiwigoLib/Proxy/PwgSessionProxy.cs
===================================================================
--- extensions/PiwigoLib/PiwigoLib/Proxy/PwgSessionProxy.cs	(revision 7160)
+++ extensions/PiwigoLib/PiwigoLib/Proxy/PwgSessionProxy.cs	(revision 11850)
@@ -28,5 +28,5 @@
         }
 
-        static internal PwgSessionProxyResponse pwg_session_login(string UserName, string Password)
+        static internal PwgSessionProxyResponse pwg_session_login(String UserName, String Password)
         {
             PwgSessionProxyResponse response = null;
Index: extensions/PiwigoLib/PiwigoLib/Proxy/PwgTagsProxy.cs
===================================================================
--- extensions/PiwigoLib/PiwigoLib/Proxy/PwgTagsProxy.cs	(revision 7160)
+++ extensions/PiwigoLib/PiwigoLib/Proxy/PwgTagsProxy.cs	(revision 11850)
@@ -12,4 +12,10 @@
     static internal class PwgTagsProxy
     {
+        /* pwg.tags.add             pwg_tag_add
+         * pwg.tags.getAdminList    pwg_tags_getAdminList
+         * pwg.tags.getImages       pwg_tags_getImages
+         * pwg.tags.getList         pwg_tags_getList
+         * */
+
         static internal PwgTagsProxyResponse pwg_tags_getList(Boolean? sortedByCounter)
         {
@@ -108,5 +114,5 @@
 
         }
-        static internal PwgAddRequestProxyResponse pwg_tag_add(string tagName)
+        static internal PwgAddRequestProxyResponse pwg_tag_add(String tagName)
         {
             PwgAddRequestProxyResponse response = null;
Index: extensions/PiwigoLib/PiwigoLib/Proxy/Response/PwgBaseProxyReponse.cs
===================================================================
--- extensions/PiwigoLib/PiwigoLib/Proxy/Response/PwgBaseProxyReponse.cs	(revision 7160)
+++ extensions/PiwigoLib/PiwigoLib/Proxy/Response/PwgBaseProxyReponse.cs	(revision 11850)
@@ -22,5 +22,5 @@
     [Serializable()]
     [XmlRoot(ElementName = "rsp")]
-    public abstract class PwgBaseProxyReponse
+    public class PwgBaseProxyReponse
     {
         [XmlAttribute(AttributeName="stat")]
Index: extensions/PiwigoLib/PiwigoLib/Proxy/Response/PwgSessionProxyResponse.cs
===================================================================
--- extensions/PiwigoLib/PiwigoLib/Proxy/Response/PwgSessionProxyResponse.cs	(revision 7160)
+++ extensions/PiwigoLib/PiwigoLib/Proxy/Response/PwgSessionProxyResponse.cs	(revision 11850)
@@ -16,5 +16,5 @@
         public String UserName { get; set; }
         [XmlElement(ElementName = "status")]
-        public string Status { get; set; }
+        public String Status { get; set; }
         [XmlElement(ElementName = "template")]
         public String Template { get; set; }
@@ -24,5 +24,8 @@
         public String Language { get; set; }
         [XmlElement(ElementName = "charset")]
-        public String CharSet { get; set; }    
+        public String CharSet { get; set; }
+        [XmlElement(ElementName = "pwg_token")]
+        public String PwgToken { get; set; }    
+
     }
 }
Index: extensions/PiwigoLib/PiwigoLib/Service/PwgCategoriesService.cs
===================================================================
--- extensions/PiwigoLib/PiwigoLib/Service/PwgCategoriesService.cs	(revision 7160)
+++ extensions/PiwigoLib/PiwigoLib/Service/PwgCategoriesService.cs	(revision 11850)
@@ -264,5 +264,81 @@
             return returnValue;
         }
-
+        /// <summary>
+        /// Delete a category
+        /// </summary>
+        /// <param name="categoryId"></param>
+        /// <param name="SecurityToken"></param>
+        /// <param name="PhotoDeletionMode"></param>
+        /// <returns></returns>
+        public Boolean DeleteCategory(Int32 categoryId, String SecurityToken, PwgCategoryPhotoDeletionModeEnum PhotoDeletionMode)
+        {
+            Boolean returnValue = false;
+
+            try
+            {
+                if (PhotoDeletionMode == PwgCategoryPhotoDeletionModeEnum.Unknow)
+                {
+                    PhotoDeletionMode = PwgCategoryPhotoDeletionModeEnum.OrphansOnly;
+                }
+
+                PwgBaseProxyReponse response = PwgCategoriesProxy.pwg_categories_delete(categoryId, SecurityToken, PhotoDeletionMode);
+
+                if (response.Retour != PwgBaseProxyReponseRetourEnum.Ok)
+                {
+                   if (response.Erreur != null)
+                    {
+                        throw new PwgServiceException("DeleteCategory, the server has return the error.",
+                            response.Erreur.Code,
+                            response.Erreur.Message);
+                    }
+                    else
+                    {
+                        throw new PwgServiceException("DeleteCategory : a error occurs during server process.");
+                    }
+                }
+                else
+                {
+                    returnValue = true;
+                }
+            }
+            catch (PwgProxyException ex)
+            {
+                throw new PwgServiceException("DeleteCategory : a error is raised by proxy.", ex);
+            }
+            return returnValue;
+        }
+
+        public Boolean MoveCategory(List<Int32> categoriesId, Int32 ParentCategoryId, String SecurityToken)
+        {
+            Boolean returnValue = false;
+
+            try
+            {
+                PwgBaseProxyReponse response = PwgCategoriesProxy.pwg_categories_move(categoriesId, ParentCategoryId, SecurityToken);
+
+                if (response.Retour != PwgBaseProxyReponseRetourEnum.Ok)
+                {
+                    if (response.Erreur != null)
+                    {
+                        throw new PwgServiceException("DeleteCategory, the server has return the error.",
+                            response.Erreur.Code,
+                            response.Erreur.Message);
+                    }
+                    else
+                    {
+                        throw new PwgServiceException("DeleteCategory : a error occurs during server process.");
+                    }
+                }
+                else
+                {
+                    returnValue = true;
+                }
+            }
+            catch (PwgProxyException ex)
+            {
+                throw new PwgServiceException("DeleteCategory : a error is raised by proxy.", ex);
+            }
+            return returnValue;
+        }
         /// <summary>
         /// convert response to dto object
@@ -301,10 +377,10 @@
                 returnValue.SubCategoriesCount = response.SubCategoriesCount;
 
-                returnValue.UpperCategoriesId = new List<int>();
+                returnValue.UpperCategoriesId = new List<Int32>();
                 if (response.UpperCategoryId != null)
                 {
-                    foreach (String stringId in response.UpperCategoryId.Split(','))
-                    {
-                        returnValue.UpperCategoriesId.Add(Int32.Parse(stringId));
+                    foreach (String StringId in response.UpperCategoryId.Split(','))
+                    {
+                        returnValue.UpperCategoriesId.Add(Int32.Parse(StringId));
                     }
                 }
Index: extensions/PiwigoLib/PiwigoLib/Service/PwgImagesService.cs
===================================================================
--- extensions/PiwigoLib/PiwigoLib/Service/PwgImagesService.cs	(revision 7160)
+++ extensions/PiwigoLib/PiwigoLib/Service/PwgImagesService.cs	(revision 11850)
@@ -9,4 +9,5 @@
 using Com.Piwigo.Lib.DTO.Helper;
 using Com.Piwigo.Lib.IService;
+using System.IO;
 
 namespace Com.Piwigo.Lib.Service
@@ -44,4 +45,37 @@
             {
                 throw new PwgServiceException("RateImage : a error is raised by proxy.", ex);
+            }
+            return returnValue;
+        }
+
+        public Boolean addImageByMultiPartForm(FileInfo fileImage, Int32? imageId, Int32? categoryId, String imageName, String imageAuthor, String imageComment, Int32? imageLevel, String imageTags)
+        {
+            Boolean returnValue = false;
+
+            try
+            {
+                PwgBaseProxyReponse response = PwgImagesProxy.pwg_images_addSimple(fileImage,imageId, categoryId, imageName, imageAuthor, imageComment, imageLevel, imageTags );
+
+                if (response.Retour != PwgBaseProxyReponseRetourEnum.Ok)
+                {
+                    if (response.Erreur != null)
+                    {
+                        throw new PwgServiceException("addImageByMultiPartForm, the server has return the error.",
+                            response.Erreur.Code,
+                            response.Erreur.Message);
+                    }
+                    else
+                    {
+                        throw new PwgServiceException("addImageByMultiPartForm : a error occurs during server process.");
+                    }
+                }
+                else
+                {
+                    returnValue = true;
+                }
+            }
+            catch (PwgProxyException ex)
+            {
+                throw new PwgServiceException("addImageByMultiPartForm : a error is raised by proxy.", ex);
             }
             return returnValue;
Index: extensions/PiwigoLib/PiwigoLib/Service/PwgSessionService.cs
===================================================================
--- extensions/PiwigoLib/PiwigoLib/Service/PwgSessionService.cs	(revision 7160)
+++ extensions/PiwigoLib/PiwigoLib/Service/PwgSessionService.cs	(revision 11850)
@@ -137,4 +137,5 @@
                 session.Theme = response.Theme;
                 session.UserName = response.UserName;
+                session.SecurityToken = response.PwgToken;
             }
 
