Changeset 11850


Ignore:
Timestamp:
Jul 29, 2011, 6:05:05 PM (13 years ago)
Author:
bayral
Message:

MAj des truc existant et debut du upload de fichier

Location:
extensions/PiwigoLib
Files:
41 edited

Legend:

Unmodified
Added
Removed
  • extensions/PiwigoLib/Piwigo.sln

    r7149 r11850  
    4040                {59F7FCF2-858A-406D-92A6-50514BD89B43}.Debug|Any CPU.ActiveCfg = Debug|x86
    4141                {59F7FCF2-858A-406D-92A6-50514BD89B43}.Debug|Mixed Platforms.ActiveCfg = Debug|x86
    42                 {59F7FCF2-858A-406D-92A6-50514BD89B43}.Debug|Mixed Platforms.Build.0 = Debug|x86
    4342                {59F7FCF2-858A-406D-92A6-50514BD89B43}.Debug|x86.ActiveCfg = Debug|x86
    4443                {59F7FCF2-858A-406D-92A6-50514BD89B43}.Debug|x86.Build.0 = Debug|x86
  • extensions/PiwigoLib/PiwigoLib/DTO/Helper/PwgEnumHelper.cs

    r7149 r11850  
    11using System;
    2 using System.Collections.Generic;
    3 using System.Linq;
    4 using System.Text;
    52using System.Reflection;
    6 using System.ComponentModel;
    73using System.Xml.Serialization;
    84
     
    117    internal static class PwgEnumHelper<T>
    128    {
    13         internal static string stringValueOf(T value)
     9        static PwgEnumHelper()
     10        {
     11            if (!typeof(T).IsEnum) {
     12                throw new ArgumentException(String.Format("PwgEnumHelper<T>(): The type {0} is not a enum.", typeof(T).Name));
     13            }
     14        }
     15
     16        internal static String StringValueOf(T value)
    1417        {
    1518            FieldInfo fi = value.GetType().GetField(value.ToString());
     
    2528        }
    2629
    27         internal static T enumValueOf(string value)
     30        internal static T enumValueOf(String value)
    2831        {
    2932            Type enumType = typeof(T);
     
    3134            foreach (T enumValue in values)
    3235            {
    33                 if (stringValueOf(enumValue).Equals(value))
     36                if (StringValueOf(enumValue).Equals(value))
    3437                {
    3538                    return enumValue;
     
    3740            }
    3841
    39             throw new ArgumentException("The string is not a description or value of the specified enum.");
     42            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));
    4043        }
    4144    }
  • extensions/PiwigoLib/PiwigoLib/DTO/PwgCategory.cs

    r3834 r11850  
    11using System;
    22using System.Collections.Generic;
    3 using System.Text;
    43
    54
     
    98    public class PwgCategory
    109    {
     10        public static Int32 RootCategoryId = 0;
     11
    1112        public Int32        Id { get; set; }
    1213        public List<Int32>  UpperCategoriesId { get; set; }
  • extensions/PiwigoLib/PiwigoLib/DTO/PwgImage.cs

    r3861 r11850  
    11using System;
    22using System.Collections.Generic;
    3 using System.Text;
    43
    54
  • extensions/PiwigoLib/PiwigoLib/DTO/PwgServiceException.cs

    r7150 r11850  
    11using System;
    2 using System.Collections.Generic;
    3 using System.Linq;
    4 using System.Text;
    5 using Com.Piwigo.Lib.IService;
    62
    73namespace Com.Piwigo.Lib.DTO
  • extensions/PiwigoLib/PiwigoLib/DTO/PwgSession.cs

    r3816 r11850  
    11using System;
    2 using System.Collections.Generic;
    3 using System.Text;
    42
    53
     
    1816        public String Theme                 { get; set; }
    1917        public String Language              { get; set; }
    20         public String CharSet               { get; set; }   
     18        public String CharSet               { get; set; }
     19        public String SecurityToken         { get; set; }   
    2120    }
    2221}
  • extensions/PiwigoLib/PiwigoLib/DTO/PwgSessionStatusEnum.cs

    r3816 r11850  
    11using System;
    2 using System.Collections.Generic;
    3 using System.Linq;
    4 using System.Text;
    52using System.Xml.Serialization;
    63
  • extensions/PiwigoLib/PiwigoLib/DTO/PwgTag.cs

    r3827 r11850  
    11using System;
    2 using System.Collections.Generic;
    3 using System.Text;
    42
    53
  • extensions/PiwigoLib/PiwigoLib/IService/IPwgCategoriesService.cs

    r7150 r11850  
    44    public interface IPwgCategoriesService
    55    {
    6         bool AddCategory(string categoryName, int? upperCatId, ref int newId, ref string messageInfo);
     6        Boolean AddCategory(String categoryName, Int32? upperCatId, ref Int32 newId, ref String messageInfo);
    77        System.Collections.Generic.List<Com.Piwigo.Lib.DTO.PwgCategory> GetAdminListOfCategory();
    8         System.Collections.Generic.List<Com.Piwigo.Lib.DTO.PwgCategory> GetListOfCategory(int? CatgeroryId, bool? Recursive, bool? PublicOnly);
    9         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);
    10         bool UpdateCategoryInfo(int IdCat, string categoryName, string categoryComment);
     8        System.Collections.Generic.List<Com.Piwigo.Lib.DTO.PwgCategory> GetListOfCategory(Int32? CatgeroryId, Boolean? Recursive, Boolean? PublicOnly);
     9        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);
     10        Boolean UpdateCategoryInfo(Int32 IdCat, String categoryName, String categoryComment);
     11        Boolean DeleteCategory(Int32 categoryId, String SecurityToken, Com.Piwigo.Lib.DTO.PwgCategoryPhotoDeletionModeEnum PhotoDeletionMode);
     12        Boolean MoveCategory(System.Collections.Generic.List<Int32> categoriesId, Int32 parentCategoryId, String SecurityToken);
    1113    }
    1214}
  • extensions/PiwigoLib/PiwigoLib/IService/IPwgImagesService.cs

    r7150 r11850  
    44    public interface IPwgImagesService
    55    {
    6         Com.Piwigo.Lib.DTO.PwgImageRate RateImage(int imageId, int imageRate);
     6        Com.Piwigo.Lib.DTO.PwgImageRate RateImage(Int32 imageId, Int32 imageRate);
     7        Boolean addImageByMultiPartForm(System.IO.FileInfo fileImage, Int32? imageId, Int32? categoryId, String imageName, String imageAuthor, String imageComment, Int32? imageLevel, String imageTags);
    78    }
    89}
  • extensions/PiwigoLib/PiwigoLib/IService/IPwgSessionService.cs

    r7150 r11850  
    55    {
    66        Com.Piwigo.Lib.DTO.PwgSession GetPwgSession();
    7         Com.Piwigo.Lib.DTO.PwgSession Login(string UserName, string Password);
     7        Com.Piwigo.Lib.DTO.PwgSession Login(String UserName, String Password);
    88        Com.Piwigo.Lib.DTO.PwgSession Logout();
    99    }
  • extensions/PiwigoLib/PiwigoLib/IService/IPwgSetupService.cs

    r7150 r11850  
    44    public interface IPwgSetupService
    55    {
    6         void Setup(string PwgUserAgent, short? PwgTimeOutInSecond, Uri serverURI);
     6        void Setup(String PwgUserAgent, Int16? PwgTimeOutInSecond, Uri serverURI);
    77    }
    88}
  • extensions/PiwigoLib/PiwigoLib/IService/IPwgTagsService.cs

    r7150 r11850  
    44    public interface IPwgTagsService
    55    {
    6         bool AddTag(string tagName, ref int newId, ref string messageInfo);
     6        Boolean AddTag(String tagName, ref Int32 newId, ref String messageInfo);
    77        System.Collections.Generic.List<Com.Piwigo.Lib.DTO.PwgTag> GetAdminListOfTag();
    8         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);
    9         System.Collections.Generic.List<Com.Piwigo.Lib.DTO.PwgTag> GetListOfTag(bool? sortedByCounter);
     8        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);
     9        System.Collections.Generic.List<Com.Piwigo.Lib.DTO.PwgTag> GetListOfTag(Boolean? sortedByCounter);
    1010    }
    1111}
  • extensions/PiwigoLib/PiwigoLib/PiwigoLib.csproj

    r7149 r11850  
    5151  </ItemGroup>
    5252  <ItemGroup>
     53    <Compile Include="DTO\PwgCategoryPhotoDeletionModeEnum.cs" />
    5354    <Compile Include="DTO\PwgCategory.cs" />
    5455    <Compile Include="DTO\PwgImage.cs" />
  • extensions/PiwigoLib/PiwigoLib/Proxy/Helper/PwgProxyReponseHelper.cs

    r7149 r11850  
    44using System.Text;
    55using System.Web;
     6
     7using Com.Piwigo.Lib.DTO.Helper;
    68
    79namespace Com.Piwigo.Lib.Proxy.Helper
     
    4850        {
    4951            String FormatString = String.Empty;
     52            String ParamValue = String.Empty;
     53           
    5054            if (value != null)
    5155            {
     
    5660                }
    5761
    58                 queryStringBuilder.AppendFormat(FormatString, paramName, HttpUtility.UrlEncode(value.ToString().ToLower()));
     62                if (typeof(T).IsEnum)
     63                {
     64                    ParamValue = HttpUtility.UrlEncode(PwgEnumHelper<T>.StringValueOf(value));
     65                }
     66                else
     67                {
     68                    ParamValue = HttpUtility.UrlEncode(value.ToString().ToLower());
     69                }
     70               
     71                queryStringBuilder.AppendFormat(FormatString, paramName, ParamValue);
     72               
    5973                firstOcc = false;
    6074            }
  • extensions/PiwigoLib/PiwigoLib/Proxy/PwgCategoriesProxy.cs

    r7149 r11850  
    1010namespace Com.Piwigo.Lib.Proxy
    1111{
     12    /// <summary>
     13    /// pwg.categories.add              pwg_categories_add
     14    /// pwg.categories.delete           pwg_categories_delete
     15    /// pwg.categories.getAdminList     pwg_categories_getAdminList
     16    /// pwg.categories.getImages        pwg_categories_getImages
     17    /// pwg.categories.getList          pwg_categories_getList
     18    /// pwg.categories.move             pwg_categories_move
     19    /// pwg.categories.setInfo          pwg_categories_setInfo
     20    /// </summary>
    1221    static internal class PwgCategoriesProxy
    1322    {
     
    200209
    201210        /// <summary>
    202         ///
    203         /// </summary>
    204         /// <param name="tagName"></param>
    205         /// <returns></returns>
    206         static internal PwgAddRequestProxyResponse pwg_tag_add(string tagName)
    207         {
    208             PwgAddRequestProxyResponse response = null;
    209             try
    210             {
    211                 StringBuilder data = new StringBuilder();
    212                 data.Append("method=pwg.tags.add");
    213                 data.Append("&name=" + HttpUtility.UrlEncode(tagName));
    214 
    215                 response = PwgGenericProxy<PwgAddRequestProxyResponse>.Post(
    216                     PwgConfigProxy.PwgServeurUri,
    217                     data.ToString());
    218             }
    219             catch (Exception ex)
    220             {
    221                 throw new PwgProxyException("pwg_tag_add", ex);
    222             }
    223 
    224             return response;
    225         }
    226 
     211        /// pwg.categories.delete
     212        /// </summary>
     213        /// <param name="CategorysId"></param>
     214        /// <param name="SecurityToken"></param>
     215        /// <param name="PhotoDeletionMode"></param>
     216        /// <returns></returns>
     217        static internal PwgBaseProxyReponse pwg_categories_delete(Int32 CategoryId,
     218                                                                  String SecurityToken,
     219                                                                  PwgCategoryPhotoDeletionModeEnum PhotoDeletionMode)
     220        {
     221            PwgBaseProxyReponse response = null;
     222            try
     223            {
     224                StringBuilder data = new StringBuilder();
     225                Boolean firstOcc = true;
     226                data.Append("method=pwg.categories.delete");
     227                firstOcc = false;
     228                PwgProxyReponseHelper.buildQueryFromValue<Int32>(CategoryId, "category_id", ref firstOcc, data);
     229                PwgProxyReponseHelper.buildQueryFromValue<String>(SecurityToken, "pwg_token", ref firstOcc, data);
     230                PwgProxyReponseHelper.buildQueryFromValue<PwgCategoryPhotoDeletionModeEnum>(PhotoDeletionMode, "photo_deletion_mode", ref firstOcc, data);
     231
     232                response = PwgGenericProxy<PwgBaseProxyReponse>.Post(
     233                                PwgConfigProxy.PwgServeurUri,
     234                                data.ToString());
     235            }
     236            catch (Exception ex)
     237            {
     238                throw new PwgProxyException("pwg_categories_delete", ex);
     239            }
     240
     241            return response;
     242        }
     243
     244        static internal PwgBaseProxyReponse pwg_categories_move(List<Int32> CategoriesId,
     245                                                                Int32 ParentCategoryId,
     246                                                                String SecurityToken)
     247        {
     248            PwgBaseProxyReponse response = null;
     249            try
     250            {
     251                StringBuilder data = new StringBuilder();
     252                Boolean firstOcc = true;
     253                data.Append("method=pwg.categories.move");
     254                firstOcc = false;
     255                PwgProxyReponseHelper.buildQueryFromArray<Int32>(CategoriesId, "category_id", ref firstOcc, data);
     256                PwgProxyReponseHelper.buildQueryFromValue<Int32>(ParentCategoryId, "parent", ref firstOcc, data);
     257                PwgProxyReponseHelper.buildQueryFromValue<String>(SecurityToken, "pwg_token", ref firstOcc, data);
     258
     259                response = PwgGenericProxy<PwgBaseProxyReponse>.Post(
     260                                PwgConfigProxy.PwgServeurUri,
     261                                data.ToString());
     262            }
     263            catch (Exception ex)
     264            {
     265                throw new PwgProxyException("pwg_categories_delete", ex);
     266            }
     267
     268            return response;
     269        }
    227270    }
    228271
  • extensions/PiwigoLib/PiwigoLib/Proxy/PwgConfigProxy.cs

    r7149 r11850  
    11using System;
    2 using System.Collections.Generic;
    3 using System.Linq;
    4 using System.Text;
    52using System.Net;
    63
  • extensions/PiwigoLib/PiwigoLib/Proxy/PwgGenericProxy.cs

    r7149 r11850  
    88using System.Xml.Serialization;
    99using System.Xml;
     10using System.Collections.Specialized;
    1011
    1112namespace Com.Piwigo.Lib.Proxy
     
    1415    static internal class PwgGenericProxy<T>
    1516    {
    16 
     17        /// <summary>
     18        /// Send Get data request to piwigo
     19        /// </summary>
     20        /// <param name="address"></param>
     21        /// <param name="methodName"></param>
     22        /// <param name="methodParameter"></param>
     23        /// <returns></returns>
    1724        internal static T Get(Uri address, String methodName, String methodParameter)
    1825        {
     
    7784        }
    7885
     86        /// <summary>
     87        /// Send Post data request to piwigo
     88        /// </summary>
     89        /// <param name="address"></param>
     90        /// <param name="data"></param>
     91        /// <returns></returns>
    7992        internal static T Post(Uri address, String data)
    8093        {
     
    144157        }
    145158
     159        private class MimePart
     160        {
     161            internal NameValueCollection Headers { get; set; }
     162            internal byte[] Header { get; set; }
     163            internal Stream Data { get; set; }
     164
     165            internal MimePart()
     166            {
     167                Headers = new NameValueCollection();
     168            }
     169        }
     170        /// <summary>
     171        ///
     172        /// </summary>
     173        /// <param name="address">URI of server</param>
     174        /// <param name="dcFiles">Dictionary(String NameOfFileFiel, String FilePath) FilePath must exist on hdd</param>
     175        /// <param name="dcFields">Dictionary(String NameOfFormField, String ValueForField) others form filed to submit</param>
     176        /// <returns></returns>
     177        internal static T PostAsMultiPartForm(Uri address, Dictionary<String, String> dcFiles, Dictionary<String, String> dcFields)
     178        {           
     179            List<MimePart> lstMimeParts = new List<MimePart>();
     180            T ReturnValue = default(T);
     181
     182            HttpWebRequest Request;
     183            HttpWebResponse Response = null;
     184           
     185            if (address == null) { throw new PwgProxyException("The get address is null."); }
     186
     187            try
     188            {
     189                // Create the web request 
     190                Request = WebRequest.Create(address) as HttpWebRequest;
     191                Request.UserAgent = PwgConfigProxy.PwgUserAgent;
     192                Request.KeepAlive = PwgConfigProxy.PwgKeepAlive;
     193                Request.Timeout = PwgConfigProxy.PwgTimeOutInSecond * 1000;
     194                Request.CookieContainer = PwgConfigProxy.cookieContainer; // get session cookie       
     195
     196                // MultiPart Post Request
     197                Request.ContentType = "multipart/form-data;";
     198                Request.Method = "POST";
     199
     200                // Loading Mine Part data from others form fields
     201                foreach (string key in dcFields.Keys)
     202                {
     203                    MimePart part = new MimePart();
     204                    part.Headers["Content-Disposition"] = "form-data; name=\"" + key + "\"";
     205                    part.Data = new MemoryStream(Encoding.UTF8.GetBytes(dcFields[key]));
     206                    lstMimeParts.Add(part);
     207                }
     208
     209                // Loading MinePart data from form file fields
     210                foreach (String strFieldName in dcFiles.Keys)
     211                {
     212                    MimePart part = new MimePart();
     213                    part.Headers["Content-Disposition"] = "form-data; name=\"" + strFieldName + "\"; filename=\"" + dcFiles[strFieldName] + "\"";
     214                    part.Headers["Content-Type"] = "application/octet-stream";
     215                    part.Data = File.OpenRead(dcFiles[strFieldName]); // Open file for getting a stream reader on it.
     216                    lstMimeParts.Add(part);
     217                }
     218
     219                string strBound = "----------" + DateTime.Now.Ticks.ToString("x");
     220                byte[] strFooter = Encoding.UTF8.GetBytes("--" + strBound + "--\r\n");
     221                Request.ContentType += " boundary=" + strBound;
     222
     223                long contentLength = 0;
     224                foreach (MimePart part in lstMimeParts)
     225                {                   
     226                    StringBuilder sb = new StringBuilder();
     227
     228                    sb.Append("--");
     229                    sb.Append(strBound);
     230                    sb.AppendLine();
     231                    foreach (string key in part.Headers.AllKeys)
     232                    {
     233                        sb.Append(key);
     234                        sb.Append(": ");
     235                        sb.AppendLine(part.Headers[key]);
     236                    }
     237                    sb.AppendLine();
     238
     239                    part.Header = Encoding.UTF8.GetBytes(sb.ToString());
     240
     241                    contentLength += part.Header.Length + part.Data.Length + 2;
     242
     243                }
     244
     245                Request.ContentLength = contentLength + strFooter.Length;
     246
     247                byte[] buffer = new byte[8192];
     248                byte[] afterFile = Encoding.UTF8.GetBytes("\r\n");
     249                int read;
     250
     251                using (Stream s = Request.GetRequestStream())
     252                {
     253                    foreach (MimePart part in lstMimeParts)
     254                    {
     255                        s.Write(part.Header, 0, part.Header.Length);
     256
     257                        while ((read = part.Data.Read(buffer, 0, buffer.Length)) > 0)
     258                            s.Write(buffer, 0, read);
     259
     260                        part.Data.Close();
     261                        part.Data.Dispose();
     262
     263                        s.Write(afterFile, 0, afterFile.Length);
     264                    }
     265
     266                    s.Write(strFooter, 0, strFooter.Length);
     267                }
     268
     269                // Get response 
     270                using (Response = Request.GetResponse() as HttpWebResponse)
     271                {
     272                    // Get the response stream 
     273                    StreamReader reader = new StreamReader(Response.GetResponseStream());
     274
     275                    ReturnValue = DeserializeObject(reader);
     276                }
     277            }
     278            catch (WebException wex)
     279            {
     280                // This exception will be raised if the server didn't return 200 - OK 
     281                // Try to retrieve more information about the network error 
     282                if (wex.Response != null)
     283                {
     284                    using (HttpWebResponse ErrorResponse = (HttpWebResponse)wex.Response)
     285                    {
     286                        throw new PwgProxyException(
     287                            String.Format(
     288                                "The server returned '{0}' with the status code {1} ({2:d}).",
     289                                ErrorResponse.StatusDescription, ErrorResponse.StatusCode,
     290                                ErrorResponse.StatusCode),
     291                            wex);
     292                    }
     293                }
     294            }
     295            catch (IOException ioex)
     296            {
     297                // This exception will be raised if file aren't ok on client
     298                if (ioex!= null)
     299                {
     300                        throw new PwgProxyException(
     301                            String.Format(
     302                                "A IO file exception stop the request building : {0}.", ioex.Message),
     303                            ioex);
     304                }
     305            }
     306            finally
     307            {
     308                if (Response != null) { Response.Close(); }
     309                foreach (MimePart part in lstMimeParts)
     310                {
     311                    if (part.Data != null)
     312                        part.Data.Dispose();
     313                }
     314            }
     315            return ReturnValue;
     316        }
     317   
     318        /// <summary>
     319        ///  return object from xml retuned by piwigo
     320        /// </summary>
     321        /// <param name="xmlData"></param>
     322        /// <returns></returns>
    146323        internal static T DeserializeObject(StreamReader xmlData)
    147324        {
    148325            T ReturnValue = default(T);
    149 
    150             try
    151             {
    152                 //Console.WriteLine(xmlData.ReadToEnd());
    153 
     326            String line = String.Empty;
     327            try
     328            {
     329#if DEBUG
     330                line = xmlData.ReadToEnd();
     331                System.Diagnostics.Debug.WriteLine(line);
     332
     333                byte[] hexLine = System.Text.Encoding.UTF8.GetBytes(line);
     334                MemoryStream m = new System.IO.MemoryStream(hexLine);
     335                StreamReader xmlDat = new StreamReader(m);
     336#else
     337                xmlDat = xmlData;
     338#endif
    154339                System.Xml.Serialization.XmlSerializer xsSerializer = new System.Xml.Serialization.XmlSerializer(typeof(T));
    155                 ReturnValue = (T)xsSerializer.Deserialize(xmlData);
     340                ReturnValue = (T)xsSerializer.Deserialize(xmlDat);
    156341            }
    157342            catch (Exception ex)
     
    160345                            String.Format(
    161346                                "The value {0} can't be deserialized in {1}, the error is {2} .",
    162                                 xmlData, typeof(T).Name, ex.Message),
     347                                line, typeof(T).Name, ex.Message),
    163348                            ex);
    164349            }
  • extensions/PiwigoLib/PiwigoLib/Proxy/PwgImagesProxy.cs

    r7149 r11850  
    77using Com.Piwigo.Lib.Proxy.Response;
    88using Com.Piwigo.Lib.Proxy.Helper;
     9using System.IO;
    910
    1011namespace Com.Piwigo.Lib.Proxy
     
    1213    static internal class PwgImagesProxy
    1314    {
     15
     16        /*
     17         * pwg.images.add
     18         * pwg.images.addChunk
     19         * pwg.images.addComment
     20         * pwg.images.addFile
     21         * pwg.images.addSimple
     22         * pwg.images.checkFiles
     23         * pwg.images.checkUpload
     24         * pwg.images.delete
     25         * pwg.images.exist
     26         * pwg.images.getInfo
     27         * pwg.images.rate                  pwg_images_rate
     28         * pwg.images.regenerateThumbnail
     29         * pwg.images.search
     30         * pwg.images.setInfo
     31         * pwg.images.setPrivacyLevel
     32 * */
     33
    1434        /// <summary>
    1535        /// pwg.images.rate
     
    4161        }
    4262
     63        static internal PwgBaseProxyReponse pwg_images_addSimple(FileInfo fileImage, Int32? imageId, Int32? categoryId, String imageName, String imageAuthor, String imageComment, Int32? imageLevel, String imageTags)
     64        {
     65            PwgBaseProxyReponse response = null;
     66
     67            Dictionary<String, String> dcFiles  = new Dictionary<string,string>();
     68            Dictionary<String, String> dcFields = new Dictionary<string,string>();
     69           
     70            try
     71            {
     72                dcFields.Add("method", "pwg.images.addSimple");
     73                if (imageId.HasValue) { dcFields.Add("image_id", imageId.Value.ToString()); }
     74                if (categoryId.HasValue) { dcFields.Add("category", categoryId.Value.ToString()); }
     75                if (imageLevel.HasValue) { dcFields.Add("level", imageLevel.Value.ToString()); }
     76                if (!String.IsNullOrEmpty(imageName)) { dcFields.Add("name", imageName); }
     77                if (!String.IsNullOrEmpty(imageAuthor)) { dcFields.Add("author", imageAuthor); }
     78                if (!String.IsNullOrEmpty(imageComment)) { dcFields.Add("comment", imageComment); }
     79                if (!String.IsNullOrEmpty(imageTags)) { dcFields.Add("tags", imageTags); }
     80
     81                if ((fileImage != null) && (fileImage.Exists))
     82                {
     83                    dcFiles.Add("image", fileImage.FullName);
     84                }
     85                else
     86                {
     87                    throw new PwgProxyException("pwg_images_addSimple : no file or wrong file info provided for fileImage");
     88                }
     89
     90                response = PwgGenericProxy<PwgBaseProxyReponse>.PostAsMultiPartForm(PwgConfigProxy.PwgServeurUri, dcFiles, dcFields);           
     91            }
     92            catch (Exception ex)
     93            {
     94                throw new PwgProxyException("pwg_images_addSimple", ex);
     95            }
     96
     97            return response;
     98        }
    4399    }
    44100
  • extensions/PiwigoLib/PiwigoLib/Proxy/PwgSessionProxy.cs

    r7149 r11850  
    2828        }
    2929
    30         static internal PwgSessionProxyResponse pwg_session_login(string UserName, string Password)
     30        static internal PwgSessionProxyResponse pwg_session_login(String UserName, String Password)
    3131        {
    3232            PwgSessionProxyResponse response = null;
  • extensions/PiwigoLib/PiwigoLib/Proxy/PwgTagsProxy.cs

    r7149 r11850  
    1212    static internal class PwgTagsProxy
    1313    {
     14        /* pwg.tags.add             pwg_tag_add
     15         * pwg.tags.getAdminList    pwg_tags_getAdminList
     16         * pwg.tags.getImages       pwg_tags_getImages
     17         * pwg.tags.getList         pwg_tags_getList
     18         * */
     19
    1420        static internal PwgTagsProxyResponse pwg_tags_getList(Boolean? sortedByCounter)
    1521        {
     
    108114
    109115        }
    110         static internal PwgAddRequestProxyResponse pwg_tag_add(string tagName)
     116        static internal PwgAddRequestProxyResponse pwg_tag_add(String tagName)
    111117        {
    112118            PwgAddRequestProxyResponse response = null;
  • extensions/PiwigoLib/PiwigoLib/Proxy/Response/PwgBaseProxyReponse.cs

    r7160 r11850  
    2222    [Serializable()]
    2323    [XmlRoot(ElementName = "rsp")]
    24     public abstract class PwgBaseProxyReponse
     24    public class PwgBaseProxyReponse
    2525    {
    2626        [XmlAttribute(AttributeName="stat")]
  • extensions/PiwigoLib/PiwigoLib/Proxy/Response/PwgSessionProxyResponse.cs

    r7160 r11850  
    1616        public String UserName { get; set; }
    1717        [XmlElement(ElementName = "status")]
    18         public string Status { get; set; }
     18        public String Status { get; set; }
    1919        [XmlElement(ElementName = "template")]
    2020        public String Template { get; set; }
     
    2424        public String Language { get; set; }
    2525        [XmlElement(ElementName = "charset")]
    26         public String CharSet { get; set; }   
     26        public String CharSet { get; set; }
     27        [XmlElement(ElementName = "pwg_token")]
     28        public String PwgToken { get; set; }   
     29
    2730    }
    2831}
  • extensions/PiwigoLib/PiwigoLib/Service/PwgCategoriesService.cs

    r7149 r11850  
    264264            return returnValue;
    265265        }
    266 
     266        /// <summary>
     267        /// Delete a category
     268        /// </summary>
     269        /// <param name="categoryId"></param>
     270        /// <param name="SecurityToken"></param>
     271        /// <param name="PhotoDeletionMode"></param>
     272        /// <returns></returns>
     273        public Boolean DeleteCategory(Int32 categoryId, String SecurityToken, PwgCategoryPhotoDeletionModeEnum PhotoDeletionMode)
     274        {
     275            Boolean returnValue = false;
     276
     277            try
     278            {
     279                if (PhotoDeletionMode == PwgCategoryPhotoDeletionModeEnum.Unknow)
     280                {
     281                    PhotoDeletionMode = PwgCategoryPhotoDeletionModeEnum.OrphansOnly;
     282                }
     283
     284                PwgBaseProxyReponse response = PwgCategoriesProxy.pwg_categories_delete(categoryId, SecurityToken, PhotoDeletionMode);
     285
     286                if (response.Retour != PwgBaseProxyReponseRetourEnum.Ok)
     287                {
     288                   if (response.Erreur != null)
     289                    {
     290                        throw new PwgServiceException("DeleteCategory, the server has return the error.",
     291                            response.Erreur.Code,
     292                            response.Erreur.Message);
     293                    }
     294                    else
     295                    {
     296                        throw new PwgServiceException("DeleteCategory : a error occurs during server process.");
     297                    }
     298                }
     299                else
     300                {
     301                    returnValue = true;
     302                }
     303            }
     304            catch (PwgProxyException ex)
     305            {
     306                throw new PwgServiceException("DeleteCategory : a error is raised by proxy.", ex);
     307            }
     308            return returnValue;
     309        }
     310
     311        public Boolean MoveCategory(List<Int32> categoriesId, Int32 ParentCategoryId, String SecurityToken)
     312        {
     313            Boolean returnValue = false;
     314
     315            try
     316            {
     317                PwgBaseProxyReponse response = PwgCategoriesProxy.pwg_categories_move(categoriesId, ParentCategoryId, SecurityToken);
     318
     319                if (response.Retour != PwgBaseProxyReponseRetourEnum.Ok)
     320                {
     321                    if (response.Erreur != null)
     322                    {
     323                        throw new PwgServiceException("DeleteCategory, the server has return the error.",
     324                            response.Erreur.Code,
     325                            response.Erreur.Message);
     326                    }
     327                    else
     328                    {
     329                        throw new PwgServiceException("DeleteCategory : a error occurs during server process.");
     330                    }
     331                }
     332                else
     333                {
     334                    returnValue = true;
     335                }
     336            }
     337            catch (PwgProxyException ex)
     338            {
     339                throw new PwgServiceException("DeleteCategory : a error is raised by proxy.", ex);
     340            }
     341            return returnValue;
     342        }
    267343        /// <summary>
    268344        /// convert response to dto object
     
    301377                returnValue.SubCategoriesCount = response.SubCategoriesCount;
    302378
    303                 returnValue.UpperCategoriesId = new List<int>();
     379                returnValue.UpperCategoriesId = new List<Int32>();
    304380                if (response.UpperCategoryId != null)
    305381                {
    306                     foreach (String stringId in response.UpperCategoryId.Split(','))
    307                     {
    308                         returnValue.UpperCategoriesId.Add(Int32.Parse(stringId));
     382                    foreach (String StringId in response.UpperCategoryId.Split(','))
     383                    {
     384                        returnValue.UpperCategoriesId.Add(Int32.Parse(StringId));
    309385                    }
    310386                }
  • extensions/PiwigoLib/PiwigoLib/Service/PwgImagesService.cs

    r7149 r11850  
    99using Com.Piwigo.Lib.DTO.Helper;
    1010using Com.Piwigo.Lib.IService;
     11using System.IO;
    1112
    1213namespace Com.Piwigo.Lib.Service
     
    4445            {
    4546                throw new PwgServiceException("RateImage : a error is raised by proxy.", ex);
     47            }
     48            return returnValue;
     49        }
     50
     51        public Boolean addImageByMultiPartForm(FileInfo fileImage, Int32? imageId, Int32? categoryId, String imageName, String imageAuthor, String imageComment, Int32? imageLevel, String imageTags)
     52        {
     53            Boolean returnValue = false;
     54
     55            try
     56            {
     57                PwgBaseProxyReponse response = PwgImagesProxy.pwg_images_addSimple(fileImage,imageId, categoryId, imageName, imageAuthor, imageComment, imageLevel, imageTags );
     58
     59                if (response.Retour != PwgBaseProxyReponseRetourEnum.Ok)
     60                {
     61                    if (response.Erreur != null)
     62                    {
     63                        throw new PwgServiceException("addImageByMultiPartForm, the server has return the error.",
     64                            response.Erreur.Code,
     65                            response.Erreur.Message);
     66                    }
     67                    else
     68                    {
     69                        throw new PwgServiceException("addImageByMultiPartForm : a error occurs during server process.");
     70                    }
     71                }
     72                else
     73                {
     74                    returnValue = true;
     75                }
     76            }
     77            catch (PwgProxyException ex)
     78            {
     79                throw new PwgServiceException("addImageByMultiPartForm : a error is raised by proxy.", ex);
    4680            }
    4781            return returnValue;
  • extensions/PiwigoLib/PiwigoLib/Service/PwgSessionService.cs

    r7149 r11850  
    137137                session.Theme = response.Theme;
    138138                session.UserName = response.UserName;
     139                session.SecurityToken = response.PwgToken;
    139140            }
    140141
  • extensions/PiwigoLib/PiwigoWpf/Command/PwgCmdBase.cs

    r7150 r11850  
    1212       #region ICommand Membres
    1313
    14        public abstract  bool CanExecute(object parameter);
     14       public abstract  Boolean CanExecute(object parameter);
    1515
    1616       public abstract void Execute(object parameter);
  • extensions/PiwigoLib/PiwigoWpf/Command/PwgCmdConnect.cs

    r7160 r11850  
    1111    public sealed class PwgCmdConnect : PwgCmdBase
    1212    {
    13         public override bool CanExecute(object parameter)
     13        public override Boolean CanExecute(object parameter)
    1414        {
    1515            Boolean retVal = false;
  • extensions/PiwigoLib/PiwigoWpf/DTO/Helper/PwgCategoryWPFHelper.cs

    r7160 r11850  
    2828                if (aPwgCategoryWPF.UpperCategoriesId == null)
    2929                {
    30                     aPwgCategoryWPF.UpperCategoriesId = new System.Collections.ObjectModel.ObservableCollection<int>();
     30                    aPwgCategoryWPF.UpperCategoriesId = new System.Collections.ObjectModel.ObservableCollection<Int32>();
    3131                }
    3232                else
     
    3535                }
    3636
    37                 foreach (int i in aPwgCategory.UpperCategoriesId)
     37                foreach (Int32 i in aPwgCategory.UpperCategoriesId)
    3838                {
    3939                    aPwgCategoryWPF.UpperCategoriesId.Add(i);
  • extensions/PiwigoLib/PiwigoWpf/Helper/AppHelper.cs

    r7160 r11850  
    1111    public class AppHelper
    1212    {
    13         private static bool? _isInDesignMode;
     13        private static Boolean? _isInDesignMode;
    1414
    1515        /// <summary>
     
    1717        /// or Visual Studio).
    1818        /// </summary>
    19         public static bool IsInDesignModeStatic
     19        public static Boolean IsInDesignModeStatic
    2020        {
    2121            get
     
    2525                    var prop = DesignerProperties.IsInDesignModeProperty;
    2626                    _isInDesignMode
    27                         = (bool)DependencyPropertyDescriptor
     27                        = (Boolean)DependencyPropertyDescriptor
    2828                        .FromProperty(prop, typeof(FrameworkElement))
    2929                        .Metadata.DefaultValue;
     
    4242            "CA1822:MarkMembersAsStatic",
    4343            Justification = "Non static member needed for data binding")]
    44         public bool IsInDesignMode
     44        public Boolean IsInDesignMode
    4545        {
    4646            get
  • extensions/PiwigoLib/PiwigoWpf/PiwigoWpf.csproj

    r7160 r11850  
    122122      <Generator>ResXFileCodeGenerator</Generator>
    123123      <LastGenOutput>Resources.Designer.cs</LastGenOutput>
     124      <SubType>Designer</SubType>
    124125    </EmbeddedResource>
    125126    <None Include="app.config" />
  • extensions/PiwigoLib/PiwigoWpf/Properties/Resources.Designer.cs

    r7150 r11850  
    11//------------------------------------------------------------------------------
    22// <auto-generated>
    3 //     Ce code a été généré par un outil.
    4 //     Version du runtime :4.0.30319.1
     3//     This code was generated by a tool.
     4//     Runtime Version:4.0.30319.235
    55//
    6 //     Les modifications apportées à ce fichier peuvent provoquer un comportement incorrect et seront perdues si
    7 //     le code est régénéré.
     6//     Changes to this file may cause incorrect behavior and will be lost if
     7//     the code is regenerated.
    88// </auto-generated>
    99//------------------------------------------------------------------------------
     
    1414   
    1515    /// <summary>
    16     ///   Une classe de ressource fortement typée destinée, entre autres, à la consultation des chaînes localisées.
     16    ///   A strongly-typed resource class, for looking up localized strings, etc.
    1717    /// </summary>
    18     // Cette classe a été générée automatiquement par la classe StronglyTypedResourceBuilder
    19     // à l'aide d'un outil, tel que ResGen ou Visual Studio.
    20     // Pour ajouter ou supprimer un membre, modifiez votre fichier .ResX, puis réexécutez ResGen
    21     // avec l'option /str ou régénérez votre projet VS.
     18    // This class was auto-generated by the StronglyTypedResourceBuilder
     19    // class via a tool like ResGen or Visual Studio.
     20    // To add or remove a member, edit your .ResX file then rerun ResGen
     21    // with the /str option, or rebuild your VS project.
    2222    [global::System.CodeDom.Compiler.GeneratedCodeAttribute("System.Resources.Tools.StronglyTypedResourceBuilder", "4.0.0.0")]
    2323    [global::System.Diagnostics.DebuggerNonUserCodeAttribute()]
     
    3434       
    3535        /// <summary>
    36         ///   Retourne l'instance ResourceManager mise en cache utilisée par cette classe.
     36        ///   Returns the cached ResourceManager instance used by this class.
    3737        /// </summary>
    3838        [global::System.ComponentModel.EditorBrowsableAttribute(global::System.ComponentModel.EditorBrowsableState.Advanced)]
     
    4848       
    4949        /// <summary>
    50         ///   Remplace la propriété CurrentUICulture du thread actuel pour toutes
    51         ///   les recherches de ressources à l'aide de cette classe de ressource fortement typée.
     50        ///   Overrides the current thread's CurrentUICulture property for all
     51        ///   resource lookups using this strongly typed resource class.
    5252        /// </summary>
    5353        [global::System.ComponentModel.EditorBrowsableAttribute(global::System.ComponentModel.EditorBrowsableState.Advanced)]
  • extensions/PiwigoLib/PiwigoWpf/Properties/Resources.resx

    r7150 r11850  
    1818    <resheader name="reader">System.Resources.ResXResourceReader, System.Windows.Forms, ...</resheader>
    1919    <resheader name="writer">System.Resources.ResXResourceWriter, System.Windows.Forms, ...</resheader>
    20     <data name="Name1"><value>this is my long string</value><comment>this is a comment</comment></data>
     20    <data name="Name1"><value>this is my long String</value><comment>this is a comment</comment></data>
    2121    <data name="Color1" type="System.Drawing.Color, System.Drawing">Blue</data>
    2222    <data name="Bitmap1" mimetype="application/x-microsoft.net.object.binary.base64">
     
    2424    </data>
    2525    <data name="Icon1" type="System.Drawing.Icon, System.Drawing" mimetype="application/x-microsoft.net.object.bytearray.base64">
    26         <value>[base64 mime encoded string representing a byte array form of the .NET Framework object]</value>
     26        <value>[base64 mime encoded String representing a byte array form of the .NET Framework object]</value>
    2727        <comment>This is a comment</comment>
    2828    </data>
     
    6868            <xsd:complexType>
    6969              <xsd:sequence>
    70                 <xsd:element name="value" type="xsd:string" minOccurs="0" />
     70                <xsd:element name="value" type="xsd:String" minOccurs="0" />
    7171              </xsd:sequence>
    72               <xsd:attribute name="name" use="required" type="xsd:string" />
    73               <xsd:attribute name="type" type="xsd:string" />
    74               <xsd:attribute name="mimetype" type="xsd:string" />
     72              <xsd:attribute name="name" use="required" type="xsd:String" />
     73              <xsd:attribute name="type" type="xsd:String" />
     74              <xsd:attribute name="mimetype" type="xsd:String" />
    7575              <xsd:attribute ref="xml:space" />
    7676            </xsd:complexType>
     
    7878          <xsd:element name="assembly">
    7979            <xsd:complexType>
    80               <xsd:attribute name="alias" type="xsd:string" />
    81               <xsd:attribute name="name" type="xsd:string" />
     80              <xsd:attribute name="alias" type="xsd:String" />
     81              <xsd:attribute name="name" type="xsd:String" />
    8282            </xsd:complexType>
    8383          </xsd:element>
     
    8585            <xsd:complexType>
    8686              <xsd:sequence>
    87                 <xsd:element name="value" type="xsd:string" minOccurs="0" msdata:Ordinal="1" />
    88                 <xsd:element name="comment" type="xsd:string" minOccurs="0" msdata:Ordinal="2" />
     87                <xsd:element name="value" type="xsd:String" minOccurs="0" msdata:Ordinal="1" />
     88                <xsd:element name="comment" type="xsd:String" minOccurs="0" msdata:Ordinal="2" />
    8989              </xsd:sequence>
    90               <xsd:attribute name="name" type="xsd:string" use="required" msdata:Ordinal="1" />
    91               <xsd:attribute name="type" type="xsd:string" msdata:Ordinal="3" />
    92               <xsd:attribute name="mimetype" type="xsd:string" msdata:Ordinal="4" />
     90              <xsd:attribute name="name" type="xsd:String" use="required" msdata:Ordinal="1" />
     91              <xsd:attribute name="type" type="xsd:String" msdata:Ordinal="3" />
     92              <xsd:attribute name="mimetype" type="xsd:String" msdata:Ordinal="4" />
    9393              <xsd:attribute ref="xml:space" />
    9494            </xsd:complexType>
     
    9797            <xsd:complexType>
    9898              <xsd:sequence>
    99                 <xsd:element name="value" type="xsd:string" minOccurs="0" msdata:Ordinal="1" />
     99                <xsd:element name="value" type="xsd:String" minOccurs="0" msdata:Ordinal="1" />
    100100              </xsd:sequence>
    101               <xsd:attribute name="name" type="xsd:string" use="required" />
     101              <xsd:attribute name="name" type="xsd:String" use="required" />
    102102            </xsd:complexType>
    103103          </xsd:element>
  • extensions/PiwigoLib/PiwigoWpf/Properties/Settings.Designer.cs

    r7150 r11850  
    2727        [global::System.Diagnostics.DebuggerNonUserCodeAttribute()]
    2828        [global::System.Configuration.DefaultSettingValueAttribute("")]
    29         public string ServerNameData {
     29        public String ServerNameData {
    3030            get {
    31                 return ((string)(this["ServerNameData"]));
     31                return ((String)(this["ServerNameData"]));
    3232            }
    3333            set {
     
    3939        [global::System.Diagnostics.DebuggerNonUserCodeAttribute()]
    4040        [global::System.Configuration.DefaultSettingValueAttribute("")]
    41         public string UserNameData {
     41        public String UserNameData {
    4242            get {
    43                 return ((string)(this["UserNameData"]));
     43                return ((String)(this["UserNameData"]));
    4444            }
    4545            set {
     
    5151        [global::System.Diagnostics.DebuggerNonUserCodeAttribute()]
    5252        [global::System.Configuration.DefaultSettingValueAttribute("")]
    53         public string PwdData {
     53        public String PwdData {
    5454            get {
    55                 return ((string)(this["PwdData"]));
     55                return ((String)(this["PwdData"]));
    5656            }
    5757            set {
     
    6363        [global::System.Diagnostics.DebuggerNonUserCodeAttribute()]
    6464        [global::System.Configuration.DefaultSettingValueAttribute("False")]
    65         public bool SaveSettingData {
     65        public Boolean SaveSettingData {
    6666            get {
    67                 return ((bool)(this["SaveSettingData"]));
     67                return ((Boolean)(this["SaveSettingData"]));
    6868            }
    6969            set {
  • extensions/PiwigoLib/TestPiwigoLib/Form1.Designer.cs

    r3821 r11850  
    1 namespace TestPiwigoLib
     1using System;
     2namespace TestPiwigoLib
    23{
    34    partial class Form1
     
    1213        /// </summary>
    1314        /// <param name="disposing">true si les ressources managées doivent être supprimées ; sinon, false.</param>
    14         protected override void Dispose(bool disposing)
     15        protected override void Dispose(Boolean disposing)
    1516        {
    1617            if (disposing && (components != null))
  • extensions/PiwigoLib/TestPiwigoLib/Form1.cs

    r7149 r11850  
    44using Com.Piwigo.Lib.IService;
    55using Com.Piwigo.Lib.DTO;
     6using System.Collections.Generic;
     7using System.IO;
    68
    79
     
    2325            UriBuilder urib = new UriBuilder();
    2426            urib.Host = tbServer.Text;
    25             urib.Path = "phpwebgallery/ws.php";
     27            urib.Path = "/ws.php";
    2628            urib.Scheme = "http://";
    2729
     
    6062                //List<PwgCategory> lstCat = PwgServiceProvider.Instance.PwgCategoriesService.GetAdminListOfCategory();
    6163
    62                 //Int32 newid = 0;
    63                 //String msg = String.Empty;
    64                 //Boolean rc = PwgServiceProvider.Instance.PwgCategoriesService.AddCategory("test_cat", 1, ref  newid, ref msg);
     64                Int32 newid = 0;
     65                String msg = String.Empty;
     66                Boolean rc;
     67                // rc = PwgServiceProvider.Instance.PwgCategoriesService.AddCategory("test_cat", 1, ref  newid, ref msg);
     68                //List<PwgCategory> lstCat = PwgServiceProvider.Instance.PwgCategoriesService.GetAdminListOfCategory();
    6569                //Console.WriteLine(String.Format("newid : {0} message : {1}", newid,msg));
    6670                //rc = PwgServiceProvider.Instance.PwgCategoriesService.UpdateCategoryInfo(newid, "test2", "rename cat");
     71                //Boolean rc = PwgServiceProvider.Instance.PwgCategoriesService.DeleteCategory(newid, sess.SecurityToken, PwgCategoryPhotoDeletionModeEnum.None);
     72                //rc = PwgServiceProvider.Instance.PwgCategoriesService.MoveCategory(new List<Int32>() { newid }, PwgCategory.RootCategoryId, sess.SecurityToken);
    6773
    68                 PwgImageRate imgRate = PwgServiceProvider.Instance.PwgImagesService.RateImage(1, 5);
     74                //lstCat = PwgServiceProvider.Instance.PwgCategoriesService.GetAdminListOfCategory();
     75
     76                FileInfo fi = new FileInfo("C:\\Users\\bayral\\Downloads\\49133_1636405570_2648232_n.jpg");
     77                rc = PwgServiceProvider.Instance.PwgImagesService.addImageByMultiPartForm(fi, null, 1, "benoit", "byarl", "test upload", 0, null);
     78
     79                //PwgImageRate imgRate = PwgServiceProvider.Instance.PwgImagesService.RateImage(1, 5);
    6980
    7081                sess = PwgServiceProvider.Instance.PwgSessionService.Logout();
  • extensions/PiwigoLib/TestPiwigoLib/Form1.resx

    r3816 r11850  
    1818    <resheader name="reader">System.Resources.ResXResourceReader, System.Windows.Forms, ...</resheader>
    1919    <resheader name="writer">System.Resources.ResXResourceWriter, System.Windows.Forms, ...</resheader>
    20     <data name="Name1"><value>this is my long string</value><comment>this is a comment</comment></data>
     20    <data name="Name1"><value>this is my long String</value><comment>this is a comment</comment></data>
    2121    <data name="Color1" type="System.Drawing.Color, System.Drawing">Blue</data>
    2222    <data name="Bitmap1" mimetype="application/x-microsoft.net.object.binary.base64">
     
    2424    </data>
    2525    <data name="Icon1" type="System.Drawing.Icon, System.Drawing" mimetype="application/x-microsoft.net.object.bytearray.base64">
    26         <value>[base64 mime encoded string representing a byte array form of the .NET Framework object]</value>
     26        <value>[base64 mime encoded String representing a byte array form of the .NET Framework object]</value>
    2727        <comment>This is a comment</comment>
    2828    </data>
     
    6868            <xsd:complexType>
    6969              <xsd:sequence>
    70                 <xsd:element name="value" type="xsd:string" minOccurs="0" />
     70                <xsd:element name="value" type="xsd:String" minOccurs="0" />
    7171              </xsd:sequence>
    72               <xsd:attribute name="name" use="required" type="xsd:string" />
    73               <xsd:attribute name="type" type="xsd:string" />
    74               <xsd:attribute name="mimetype" type="xsd:string" />
     72              <xsd:attribute name="name" use="required" type="xsd:String" />
     73              <xsd:attribute name="type" type="xsd:String" />
     74              <xsd:attribute name="mimetype" type="xsd:String" />
    7575              <xsd:attribute ref="xml:space" />
    7676            </xsd:complexType>
     
    7878          <xsd:element name="assembly">
    7979            <xsd:complexType>
    80               <xsd:attribute name="alias" type="xsd:string" />
    81               <xsd:attribute name="name" type="xsd:string" />
     80              <xsd:attribute name="alias" type="xsd:String" />
     81              <xsd:attribute name="name" type="xsd:String" />
    8282            </xsd:complexType>
    8383          </xsd:element>
     
    8585            <xsd:complexType>
    8686              <xsd:sequence>
    87                 <xsd:element name="value" type="xsd:string" minOccurs="0" msdata:Ordinal="1" />
    88                 <xsd:element name="comment" type="xsd:string" minOccurs="0" msdata:Ordinal="2" />
     87                <xsd:element name="value" type="xsd:String" minOccurs="0" msdata:Ordinal="1" />
     88                <xsd:element name="comment" type="xsd:String" minOccurs="0" msdata:Ordinal="2" />
    8989              </xsd:sequence>
    90               <xsd:attribute name="name" type="xsd:string" use="required" msdata:Ordinal="1" />
    91               <xsd:attribute name="type" type="xsd:string" msdata:Ordinal="3" />
    92               <xsd:attribute name="mimetype" type="xsd:string" msdata:Ordinal="4" />
     90              <xsd:attribute name="name" type="xsd:String" use="required" msdata:Ordinal="1" />
     91              <xsd:attribute name="type" type="xsd:String" msdata:Ordinal="3" />
     92              <xsd:attribute name="mimetype" type="xsd:String" msdata:Ordinal="4" />
    9393              <xsd:attribute ref="xml:space" />
    9494            </xsd:complexType>
     
    9797            <xsd:complexType>
    9898              <xsd:sequence>
    99                 <xsd:element name="value" type="xsd:string" minOccurs="0" msdata:Ordinal="1" />
     99                <xsd:element name="value" type="xsd:String" minOccurs="0" msdata:Ordinal="1" />
    100100              </xsd:sequence>
    101               <xsd:attribute name="name" type="xsd:string" use="required" />
     101              <xsd:attribute name="name" type="xsd:String" use="required" />
    102102            </xsd:complexType>
    103103          </xsd:element>
  • extensions/PiwigoLib/TestPiwigoLib/Program.cs

    r3816 r11850  
    99    {
    1010        /// <summary>
    11         /// Point d'entrée principal de l'application.
     11        /// PoInt32 d'entrée principal de l'application.
    1212        /// </summary>
    1313        [STAThread]
  • extensions/PiwigoLib/TestPiwigoLib/Properties/Resources.Designer.cs

    r6811 r11850  
    11//------------------------------------------------------------------------------
    22// <auto-generated>
    3 //     Ce code a été généré par un outil.
    4 //     Version du runtime :4.0.30319.1
     3//     This code was generated by a tool.
     4//     Runtime Version:4.0.30319.235
    55//
    6 //     Les modifications apportées à ce fichier peuvent provoquer un comportement incorrect et seront perdues si
    7 //     le code est régénéré.
     6//     Changes to this file may cause incorrect behavior and will be lost if
     7//     the code is regenerated.
    88// </auto-generated>
    99//------------------------------------------------------------------------------
     
    1414   
    1515    /// <summary>
    16     ///   Une classe de ressource fortement typée destinée, entre autres, à la consultation des chaînes localisées.
     16    ///   A strongly-typed resource class, for looking up localized strings, etc.
    1717    /// </summary>
    18     // Cette classe a été générée automatiquement par la classe StronglyTypedResourceBuilder
    19     // à l'aide d'un outil, tel que ResGen ou Visual Studio.
    20     // Pour ajouter ou supprimer un membre, modifiez votre fichier .ResX, puis réexécutez ResGen
    21     // avec l'option /str ou régénérez votre projet VS.
     18    // This class was auto-generated by the StronglyTypedResourceBuilder
     19    // class via a tool like ResGen or Visual Studio.
     20    // To add or remove a member, edit your .ResX file then rerun ResGen
     21    // with the /str option, or rebuild your VS project.
    2222    [global::System.CodeDom.Compiler.GeneratedCodeAttribute("System.Resources.Tools.StronglyTypedResourceBuilder", "4.0.0.0")]
    2323    [global::System.Diagnostics.DebuggerNonUserCodeAttribute()]
     
    3434       
    3535        /// <summary>
    36         ///   Retourne l'instance ResourceManager mise en cache utilisée par cette classe.
     36        ///   Returns the cached ResourceManager instance used by this class.
    3737        /// </summary>
    3838        [global::System.ComponentModel.EditorBrowsableAttribute(global::System.ComponentModel.EditorBrowsableState.Advanced)]
     
    4848       
    4949        /// <summary>
    50         ///   Remplace la propriété CurrentUICulture du thread actuel pour toutes
    51         ///   les recherches de ressources à l'aide de cette classe de ressource fortement typée.
     50        ///   Overrides the current thread's CurrentUICulture property for all
     51        ///   resource lookups using this strongly typed resource class.
    5252        /// </summary>
    5353        [global::System.ComponentModel.EditorBrowsableAttribute(global::System.ComponentModel.EditorBrowsableState.Advanced)]
  • extensions/PiwigoLib/TestPiwigoLib/Properties/Resources.resx

    r3816 r11850  
    1818    <resheader name="reader">System.Resources.ResXResourceReader, System.Windows.Forms, ...</resheader>
    1919    <resheader name="writer">System.Resources.ResXResourceWriter, System.Windows.Forms, ...</resheader>
    20     <data name="Name1"><value>this is my long string</value><comment>this is a comment</comment></data>
     20    <data name="Name1"><value>this is my long String</value><comment>this is a comment</comment></data>
    2121    <data name="Color1" type="System.Drawing.Color, System.Drawing">Blue</data>
    2222    <data name="Bitmap1" mimetype="application/x-microsoft.net.object.binary.base64">
     
    2424    </data>
    2525    <data name="Icon1" type="System.Drawing.Icon, System.Drawing" mimetype="application/x-microsoft.net.object.bytearray.base64">
    26         <value>[base64 mime encoded string representing a byte array form of the .NET Framework object]</value>
     26        <value>[base64 mime encoded String representing a byte array form of the .NET Framework object]</value>
    2727        <comment>This is a comment</comment>
    2828    </data>
     
    6767            <xsd:complexType>
    6868              <xsd:sequence>
    69                 <xsd:element name="value" type="xsd:string" minOccurs="0" />
     69                <xsd:element name="value" type="xsd:String" minOccurs="0" />
    7070              </xsd:sequence>
    71               <xsd:attribute name="name" type="xsd:string" />
    72               <xsd:attribute name="type" type="xsd:string" />
    73               <xsd:attribute name="mimetype" type="xsd:string" />
     71              <xsd:attribute name="name" type="xsd:String" />
     72              <xsd:attribute name="type" type="xsd:String" />
     73              <xsd:attribute name="mimetype" type="xsd:String" />
    7474            </xsd:complexType>
    7575          </xsd:element>
    7676          <xsd:element name="assembly">
    7777            <xsd:complexType>
    78               <xsd:attribute name="alias" type="xsd:string" />
    79               <xsd:attribute name="name" type="xsd:string" />
     78              <xsd:attribute name="alias" type="xsd:String" />
     79              <xsd:attribute name="name" type="xsd:String" />
    8080            </xsd:complexType>
    8181          </xsd:element>
     
    8383            <xsd:complexType>
    8484              <xsd:sequence>
    85                 <xsd:element name="value" type="xsd:string" minOccurs="0" msdata:Ordinal="1" />
    86                 <xsd:element name="comment" type="xsd:string" minOccurs="0" msdata:Ordinal="2" />
     85                <xsd:element name="value" type="xsd:String" minOccurs="0" msdata:Ordinal="1" />
     86                <xsd:element name="comment" type="xsd:String" minOccurs="0" msdata:Ordinal="2" />
    8787              </xsd:sequence>
    88               <xsd:attribute name="name" type="xsd:string" msdata:Ordinal="1" />
    89               <xsd:attribute name="type" type="xsd:string" msdata:Ordinal="3" />
    90               <xsd:attribute name="mimetype" type="xsd:string" msdata:Ordinal="4" />
     88              <xsd:attribute name="name" type="xsd:String" msdata:Ordinal="1" />
     89              <xsd:attribute name="type" type="xsd:String" msdata:Ordinal="3" />
     90              <xsd:attribute name="mimetype" type="xsd:String" msdata:Ordinal="4" />
    9191            </xsd:complexType>
    9292          </xsd:element>
     
    9494            <xsd:complexType>
    9595              <xsd:sequence>
    96                 <xsd:element name="value" type="xsd:string" minOccurs="0" msdata:Ordinal="1" />
     96                <xsd:element name="value" type="xsd:String" minOccurs="0" msdata:Ordinal="1" />
    9797              </xsd:sequence>
    98               <xsd:attribute name="name" type="xsd:string" use="required" />
     98              <xsd:attribute name="name" type="xsd:String" use="required" />
    9999            </xsd:complexType>
    100100          </xsd:element>
  • extensions/PiwigoLib/TestPiwigoLib/Properties/Settings.Designer.cs

    r6811 r11850  
    99//------------------------------------------------------------------------------
    1010
     11using System;
    1112namespace TestPiwigoLib.Properties {
    1213   
     
    2728        [global::System.Diagnostics.DebuggerNonUserCodeAttribute()]
    2829        [global::System.Configuration.DefaultSettingValueAttribute("")]
    29         public string userData {
     30        public String userData {
    3031            get {
    31                 return ((string)(this["userData"]));
     32                return ((String)(this["userData"]));
    3233            }
    3334            set {
     
    3940        [global::System.Diagnostics.DebuggerNonUserCodeAttribute()]
    4041        [global::System.Configuration.DefaultSettingValueAttribute("")]
    41         public string pwdData {
     42        public String pwdData {
    4243            get {
    43                 return ((string)(this["pwdData"]));
     44                return ((String)(this["pwdData"]));
    4445            }
    4546            set {
     
    5152        [global::System.Diagnostics.DebuggerNonUserCodeAttribute()]
    5253        [global::System.Configuration.DefaultSettingValueAttribute("")]
    53         public string serverUrlData {
     54        public String serverUrlData {
    5455            get {
    55                 return ((string)(this["serverUrlData"]));
     56                return ((String)(this["serverUrlData"]));
    5657            }
    5758            set {
Note: See TracChangeset for help on using the changeset viewer.